Skip to content

Instantly share code, notes, and snippets.

View Lakerfield's full-sized avatar

Michael Lakerveld Lakerfield

View GitHub Profile
@Lakerfield
Lakerfield / InExpression.MD
Created October 19, 2022 14:12 — forked from bartdesmet/InExpression.MD
Roslyn workshop (Techorama) - Add a new `in` expression to C#

Add a new in expression to C#

Goals

In this workshop, we'll add a new in expression to C#, with example use cases shown below:

x in 1..10     // x >= 1 && x < 10
'a' in "bar"   // "bar".IndexOf('a') >= 0   -or-   "bar".Contains('a')
x in xs // xs.Contains(x)