LANGUAGE

List pattern

Matches supported indexable sequence shapes; the slice can match zero or more elements.

Formal Syntax & Structure

csharp syntaxcsharp
value is [first, .., last]

Working Example

Example Snippetcsharp
int[] codes = { 7, 0 };System.Console.WriteLine(codes is [7, .., 0]);
C# & .NET Reference