AlgoMaster Logo

List Patterns

Low Priority25 min readUpdated June 6, 2026

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.