IList<T>.Insert(Int32, T) メソッド
定義
public:
void Insert(int index, T item);
public void Insert (int index, T item);
abstract member Insert : int * 'T -> unit
Public Sub Insert (index As Integer, item As T)
パラメーター
- index
- Int32
item
を挿入する位置の、0 から始まるインデックス。The zero-based index at which item
should be inserted.
例外
注釈
index
が IList<T> 内の項目数に等しければ、item
がリストに追加されます。If index
equals the number of items in the IList<T>, then item
is appended to the list.
リストなどの連続する要素のコレクションでは、新しい要素を挿入するために、挿入位置より後にある要素の位置が繰り下げられます。In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. コレクションにインデックスがある場合、移動した要素のインデックスも更新されます。If the collection is indexed, the indexes of the elements that are moved are also updated. この動作は、要素が概念的にバケットにグループ化されているハッシュ テーブルなどのコレクションには適用されません。This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table.