ImmutableArrayExtensions::Last<T> Method (ImmutableArray<T>, Func<T, Boolean>^)

 

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

Namespace:   System.Linq
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public:
generic<typename T>
[ExtensionAttribute]
static T Last(
	ImmutableArray<T> immutableArray,
	Func<T, bool>^ predicate
)

Parameters

immutableArray
Type: System.Collections.Immutable::ImmutableArray<T>

The array to retrieve elements from.

predicate
Type: System::Func<T, Boolean>^

The delegate that defines the conditions of the element to retrieve.

Return Value

Type: T

The last element of the array that satisfies the predicate condition.

Type Parameters

T

The type of element contained by the collection.

Exception Condition
InvalidOperationException

Thrown if the collection is empty.

Return to top
Show: