ImmutableArrayExtensions::Last<T> Method (ImmutableArray<T>)
Returns the last element of the array.
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
public: generic<typename T> [ExtensionAttribute] static T Last( ImmutableArray<T> immutableArray )
Parameters
- immutableArray
-
Type:
System.Collections.Immutable::ImmutableArray<T>
The array to retrieve items from.
Return Value
Type: TThe last element in the array.
Type Parameters
- T
The type of element contained by the array.
| Exception | Condition |
|---|---|
| InvalidOperationException | Thrown if the collection is empty. |
Show: