Mono Class Library: System.Collections.Generic.List<T> Overview | Members

System.Collections.Generic.List<T>.FindLast Method

Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire List.

public T FindLast (Predicate<T> match)

Parameters

match
The predicate delegate that specifies the element to search for.

Returns

The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type T.

Exceptions

TypeReason
ArgumentNullExceptionmatch is null.

Remarks

The predicate is a delegate that returns true if the object passed to it matches the conditions defined in the delegate. The elements of the current List are individually passed to the predicate delegate, moving backward in the List, starting with the last element and ending with the first element. Processing is stopped when a match is found.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0