Enumerable.SkipLast<TSource>(IEnumerable<TSource>, Int32) Metod

Definition

Returnerar en ny uppräkningsbar samling som innehåller elementen från source med de sista count elementen i källsamlingen som utelämnas.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<TSource> ^ SkipLast(System::Collections::Generic::IEnumerable<TSource> ^ source, int count);
public static System.Collections.Generic.IEnumerable<TSource> SkipLast<TSource>(this System.Collections.Generic.IEnumerable<TSource> source, int count);
static member SkipLast : seq<'Source> * int -> seq<'Source>
<Extension()>
Public Function SkipLast(Of TSource) (source As IEnumerable(Of TSource), count As Integer) As IEnumerable(Of TSource)

Typparametrar

TSource

Typ av element i den uppräkningsbara samlingen.

Parametrar

source
IEnumerable<TSource>

En uppräkningsbar samlingsinstans.

count
Int32

Antalet element som ska utelämnas från slutet av samlingen.

Returer

IEnumerable<TSource>

En ny uppräkningsbar samling som innehåller elementen från source minuselement count från slutet av samlingen.

Undantag

source är null.

Kommentarer

Om count inte är ett positivt tal returnerar den här metoden en identisk kopia av den source uppräkningsbara samlingen.

Gäller för