OrderedDictionary<TKey,TValue>.Insert(Int32, TKey, TValue) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在指定的索引處插入一個項目。
public:
void Insert(int index, TKey key, TValue value);
public void Insert(int index, TKey key, TValue value);
member this.Insert : int * 'Key * 'Value -> unit
Public Sub Insert (index As Integer, key As TKey, value As TValue)
參數
- index
- Int32
應插入項目的以零為基礎的索引。
- key
- TKey
插入的關鍵。
- value
- TValue
要插入的值。
例外狀況
關鍵是 null。
具有相同鍵的元素已存在 OrderedDictionary<TKey,TValue>於 中。
index 小於 0 或大於 Count。