ImmutableArray<T>.IImmutableList<T>.Insert(Int32, T) 方法

定义

返回一个新数组,指定的值已插入到该数组的指定位置。Returns a new array with the specified value inserted at the specified position.

 virtual System::Collections::Immutable::IImmutableList<T> ^ System.Collections.Immutable.IImmutableList<T>.Insert(int index, T element) = System::Collections::Immutable::IImmutableList<T>::Insert;
System.Collections.Immutable.IImmutableList<T> IImmutableList<T>.Insert (int index, T element);
abstract member System.Collections.Immutable.IImmutableList<T>.Insert : int * 'T -> System.Collections.Immutable.IImmutableList<'T>
override this.System.Collections.Immutable.IImmutableList<T>.Insert : int * 'T -> System.Collections.Immutable.IImmutableList<'T>
Function Insert (index As Integer, element As T) As IImmutableList(Of T) Implements IImmutableList(Of T).Insert

参数

index
Int32

数组中从 0 开始的索引,新项应插入到该位置。The 0-based index into the array at which the new item should be added.

element
T

要插入到数组开始处的项。The item to insert at the start of the array.

返回

IImmutableList<T>

已插入指定值的新数组。A new array with the specified value inserted.

实现

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 ImmutableArray<T> 实例被强制转换为 IImmutableList<T> 接口时使用。It can be used only when the ImmutableArray<T> instance is cast to an IImmutableList<T> interface.

适用于