Enumerable.TakeLast<TSource>(IEnumerable<TSource>, Int32) メソッド

定義

source の最後の count 要素を含む、列挙可能な新しいコレクションを返します。

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)

型パラメーター

TSource

列挙可能なコレクション内の要素の型。

パラメーター

source
IEnumerable<TSource>

列挙可能なコレクション インスタンス。

count
Int32

コレクションの末尾から取得する要素の数。

戻り値

IEnumerable<TSource>

source の最後の count 要素を含む、列挙可能な新しいコレクション。

例外

sourcenullです。

注釈

が正の数でない場合 count 、このメソッドは空の列挙可能なコレクションを返します。

適用対象