Enumerable.TakeLast<TSource>(IEnumerable<TSource>, Int32) Metoda

Definicja

Zwraca nową kolekcję wyliczalną zawierającą ostatnie count elementy z klasy source.

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

Parametry typu

TSource

Typ elementów w kolekcji wyliczalnej.

Parametry

source
IEnumerable<TSource>

Wyliczalne wystąpienie kolekcji.

count
Int32

Liczba elementów do podjęcia od końca kolekcji.

Zwraca

IEnumerable<TSource>

Nowa kolekcja wyliczalna zawierająca ostatnie count elementy z klasy source.

Wyjątki

source to null.

Uwagi

Jeśli count nie jest liczbą dodatnią, ta metoda zwraca pustą kolekcję wyliczalną.

Dotyczy