Collection<T>.IList.Insert(Int32, Object) 方法

定义

将项 IList 插入指定索引处。

 virtual void System.Collections.IList.Insert(int index, System::Object ^ value) = System::Collections::IList::Insert;
void IList.Insert(int index, object value);
abstract member System.Collections.IList.Insert : int * obj -> unit
override this.System.Collections.IList.Insert : int * obj -> unit
Sub Insert (index As Integer, value As Object) Implements IList.Insert

参数

index
Int32

应插入的从零开始 value 的索引。

value
Object

Object插入到 .IList

实现

例外

index 不是 . 中的 IList有效索引。

value 是不可分配给该类型的 IList类型。

注解

如果 index 等于其中 IList项数,则将 value 追加到末尾。

此方法是 O(n) 操作,其中 nCount

适用于