IEnumerable.where Method

Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.
 

Parameters

predicate

Type: Function
A function to test each source element for a condition; the second parameter of the function represents the index of the source element.

Return Value


Type: IEnumerable
An enumerable that contains elements from the input sequence that satisfy the condition.