List<T>.Slice(Int32, Int32) Metod

Definition

Skapar en ytlig kopia av ett område med element i källan List<T>.

public:
 System::Collections::Generic::List<T> ^ Slice(int start, int length);
public System.Collections.Generic.List<T> Slice(int start, int length);
member this.Slice : int * int -> System.Collections.Generic.List<'T>
Public Function Slice (start As Integer, length As Integer) As List(Of T)

Parametrar

start
Int32

Det nollbaserade List<T> index som intervallet börjar med.

length
Int32

Längden på intervallet.

Returer

En ytlig kopia av ett område med element i källan List<T>.

Undantag

start är mindre än 0.

-eller-

length är mindre än 0.

start och length ange inte ett giltigt intervall med element i List<T>.

Gäller för