CollectionExtensions.InsertRange<T> 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将跨度 List<T> 元素插入到指定索引处。
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static void InsertRange(System::Collections::Generic::List<T> ^ list, int index, ReadOnlySpan<T> source);
public static void InsertRange<T>(this System.Collections.Generic.List<T> list, int index, scoped ReadOnlySpan<T> source);
public static void InsertRange<T>(this System.Collections.Generic.List<T> list, int index, ReadOnlySpan<T> source);
static member InsertRange : System.Collections.Generic.List<'T> * int * ReadOnlySpan<'T> -> unit
<Extension()>
Public Sub InsertRange(Of T) (list As List(Of T), index As Integer, source As ReadOnlySpan(Of T))
类型参数
- T
列表中的元素类型。
参数
- list
- List<T>
应在其中插入元素的列表。
- index
- Int32
应插入新元素的从零开始的索引。
- source
- ReadOnlySpan<T>
其元素应添加到的 List<T>跨度。
例外
list 是 null。
index 小于 0 或大于 list's Count。