語言

Vector<T>.Item[Int32] 屬性

定義

取得該元素在指定的索引。

public:
 property T default[int] { T get(int index); };
public T this[int index] { get; }
member this.Item(int) : 'T
member this.Item(int) : 'T
Default Public ReadOnly Property Item(index As Integer) As T

參數

index
Int32

要傳回的項目索引。

屬性值

T

位於索引 index的元素。

例外狀況

index 小於零。

-或-

index大於或等於。Count

.NET 5 及以後版本:不支援型別 T 。

index 小於零或大於元素數。

適用於