ImmutableArrayExtensions.ElementAt<T>(ImmutableArray<T>, Int32) 方法

定义

返回数组中指定索引处的元素。Returns the element at a specified index in the array.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T ElementAt(System::Collections::Immutable::ImmutableArray<T> immutableArray, int index);
public static T ElementAt<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, int index);
static member ElementAt : System.Collections.Immutable.ImmutableArray<'T> * int -> 'T
<Extension()>
Public Function ElementAt(Of T) (immutableArray As ImmutableArray(Of T), index As Integer) As T

类型参数

T

集合包含的元素的类型。The type of element contained by the collection.

参数

immutableArray
ImmutableArray<T>

要在其中查找元素的数组。The array to find an element in.

index
Int32

要检索的元素的索引。The index for the element to retrieve.

返回

T

指定索引处的项。The item at the specified index.

适用于