IEnumerable<T>.Last Method

Overloads

Last

Returns the last element of the sequence.

Last(Predicate<T>)

Returns the last element of the sequence that satisfies the specified condition.

Last

Returns the last element of the sequence.

Delphi
function Last: T

Returns

T

The value at the last position in the sequence.

Exceptions

The sequence is empty.

Last(Predicate<T>)

Returns the last element of the sequence that satisfies the specified condition.

Delphi
function Last(const predicate: Predicate<T>): T

Parameters

predicate
Predicate<T>

A function to test each element for a condition.

Returns

T

The last 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.