ImmutableArrayExtensions::ElementAtOrDefault<T> Method (ImmutableArray<T>, Int32)
Returns the element at a specified index in a sequence or a default value if the index is out of range.
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
public: generic<typename T> [ExtensionAttribute] static T ElementAtOrDefault( ImmutableArray<T> immutableArray, int index )
Parameters
- immutableArray
-
Type:
System.Collections.Immutable::ImmutableArray<T>
The array to find an element in.
- index
-
Type:
System::Int32
The index for the element to retrieve.
Return Value
Type: TThe item at the specified index, or the default value if the index is not found.
Type Parameters
- T
The type of element contained by the collection.
Show: