Where()

A LINQ operation that keeps only items satisfying a condition.

What does Where() do in C#?

Where() — A LINQ operation that keeps only items satisfying a condition.

class NameFilter
{
    IEnumerable<string> ShortNames(IEnumerable<string> names)
    {
        return names.Where(name => name.Length < 5);
    }
}

Level: Freelancer · More C# terms at this level

Updated