C# 11 – List Patterns



C# 11 – List Patterns

C# 11 - List Patterns

Need to analyse lists of arbitrary length? C# 11 gives us list pattern matching.

Source code available at: https://github.com/JasperKent/List-Patterns

Topics include:
– Discarding with ‘_’
– Switch expressions
– Extracting data with a declaration pattern
– Matching against Lists and arrays
– Capturing ranges with ‘..’
– Combining list and relational patterns

And did anyone spot the ‘deliberate’ mistake that the video title says C# 8 not C# 11? Don’t know what I was thinking of.

Comments are closed.