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];
C# 14 · Collections and LINQ
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];
Was this page helpful?