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

定義

シーケンスの要素を最大サイズの sizeチャンクに分割します。

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

型パラメーター

TSource

source の要素の型。

パラメーター

source
IEnumerable<TSource>

IEnumerable<T>チャンクする要素を持つ 。

size
Int32

各チャンクの最大サイズ。

戻り値

IEnumerable<TSource[]>

IEnumerable<T>入力シーケンスがサイズ sizeのチャンクに分割された要素を格納する 。

例外

sourcenullです。

size は 1 未満です。

注釈

最後のチャンクを除く各チャンクのサイズ sizeは になります。 最後のチャンクには残りの要素が含まれており、サイズが小さい場合があります。

適用対象

こちらもご覧ください