IEnumerable<T>.First Method
Overloads
| First |
Returns the first element of the sequence. |
| First(Predicate<T>) |
Returns the first element in the sequence that satisfies a specified condition. |
Returns the first element of the sequence.
Delphi
function First: T
Returns
T
The first element in the sequence.
Exceptions
The sequence is empty.
Returns the first element in the sequence that satisfies a specified condition.
Delphi
function First(const predicate: Predicate<T>): T
Parameters
- predicate
- Predicate<T>
A function to test each element for a condition.
Returns
T
The first element in the sequence that passes the test in the specified predicate function.
Exceptions
predicate is nil .
No element satisfies the condition in predicate .
-or-
The sequence is empty.