TListBase<T>.LastOrDefault(T) Method

Returns the last element of a sequence, or the specified default value if the sequence contains no elements.

Namespace: Spring.Collections.Base
public
 function LastOrDefault(const defaultValue: T): T; overload; override;

Parameters

defaultValue
Type: T

The value to return if the sequence contains no elements.

Return Value

Type: T

DefaultValue if the source sequence is empty; otherwise, the last element in the IEnumerable<T>.

Overrides

TEnumerableBase<T>.LastOrDefault(T)