ImmutableArrayExtensions::LastOrDefault<T> Method (ImmutableArray<T>, Func<T, Boolean>^)
Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
public: generic<typename T> [ExtensionAttribute] static T LastOrDefault( ImmutableArray<T> immutableArray, Func<T, bool>^ predicate )
Parameters
- immutableArray
-
Type:
System.Collections.Immutable::ImmutableArray<T>
The array to retrieve an element from.
- predicate
-
Type:
System::Func<T, Boolean>^
The delegate that defines the conditions of the element to search for.
Return Value
Type: TThe last element of a sequence, or a default value if the sequence contains no elements.
Type Parameters
- T
The type of element contained by the collection.
Show: