AlgoMaster Logo

List Patterns

Last Updated: May 22, 2026

Low Priority
12 min read

List patterns match the shape of an array, a List<T>, or anything sequence-like by writing the expected elements inside square brackets. They arrived in C# 11 and finished the pattern matching story: where property patterns describe an object's fields, list patterns describe an object's contents. This chapter covers the bracket syntax, the slice operator .., where these patterns work, where they don't, and the runtime cost of each match.

Premium Content

Subscribe to unlock full access to this content and more premium articles.