Enumerable.where Method

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

Parameters

source

Type: IEnumerable
An enumerable to filter.
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.