A filtering operation restricts the result set to contain only those elements that satisfy a specified condition.

Methods

MethodDescriptionQuery expression
OfTypeSelects values depending on their ability to be cast to the specified typeN/A
WhereSelects values based on a predicate functionN/A

Example

string[] words = { "the", "quick", "brown", "fox", "jumps" };

words.Where(w => w.Length == 3);