IEnumerable<T>.Where Method

Overloads

Where(Predicate<T>)

Filters the sequence based on the specified predicate.

Where(Func<T,Integer,Boolean>)

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

Where(Predicate<T>)

Filters the sequence based on the specified predicate.

Delphi
function Where(const predicate: Predicate<T>): IEnumerable<T>

Parameters

predicate
Predicate<T>

A function to test each element for a condition.

Returns

IEnumerable<T>

A sequence that contains elements from the input sequence that satisfy the condition.

Exceptions

predicate is nil .

Where(Func<T,Integer,Boolean>)

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

Delphi
function Where(const predicate: Func<T, Integer, Boolean>): IEnumerable<T>

Parameters

predicate
Func<T, Integer, Boolean>

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

Returns

IEnumerable<T>

A sequence that contains elements from the input sequence that satisfy the condition.

Exceptions

predicate is nil .