C# 14 · Collections and LINQ
Filter and transform
LINQ methods work on any sequence. Nothing runs until you enumerate the result.
var names = users.Where(u => u.Age >= 18).Select(u => u.Name).ToList();
C# 14 · Collections and LINQ
LINQ methods work on any sequence. Nothing runs until you enumerate the result.
var names = users.Where(u => u.Age >= 18).Select(u => u.Name).ToList();
Was this page helpful?