CollectionExtensions.InsertRange<T> Metod

Definition

Infogar elementen i ett spann i List<T> det angivna indexet.

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))

Typparametrar

T

Typ av element i listan.

Parametrar

list
List<T>

Listan som elementen ska infogas i.

index
Int32

Det nollbaserade index där de nya elementen ska infogas.

source
ReadOnlySpan<T>

Det span vars element ska läggas till i List<T>.

Undantag

list är null.

index är mindre än 0 eller större än list's Count.

Gäller för