C# 14 · Collections and LINQ

Create collections concisely

Collection expressions build arrays, lists and spans with the same syntax. .. spreads another collection.

int[] a = [1, 2, 3];
List<int> b = [..a, 4, 5];

Official C# 14 documentation

More collections and linq commands

All collections and linq commands · C# 14 cheatsheet

Was this page helpful?