C# LINQ — “Where”

LINQ (Language-Integrated Query) is a set of integrated C# capabilities which allow queries against data.

Today’s Objective: Explore the capabilities and usage of the LINQ Where method to search collections for met conditions.

The Where Method:

The Where method of LINQ can filter a collection of data, and return a new collection containing only the data values which meet the condition/s specified in the Where call.

Microsoft Documentation

An Example:

Of course, the Where method doesn’t only apply to character count.

The Where method makes it super easy to filter and search through data based on a huge range of possible conditions. The syntax is simple to learn, understand and use.

The Syntax:

--

--

Vincent Taylor

Unity game developer / C# Programmer / Gamer. Australian (Tasmanian) indie games developer for 10+ years. Currently looking for games industry employment.