Namespace: Assorted.Utils.Collections
Assembly: Assorted.Utils (Assorted.Utils.dll) version 1.1.0.0
Splits the sequence into a fixed-size chunks.
public static IEnumerable<IEnumerable<TSource>> Partition<TSource>(
this IEnumerable<TSource> source,
int size
)
TSource
The type of elements in the source
.
source
: IEnumerable<TSource>
A sequence of values.
size
: int
The size of each chunk.
IEnumerable<IEnumerable<TSource>>
An System.Collections.Generic.IEnumerable<T>
where each of its elements are also an System.Collections.Generic.IEnumerable<T>
.
Exception | Description |
---|---|
System.ArgumentNullException | source is null . |
System.ArgumentOutOfRangeException | size is zero or negative. |
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action.
This document is generated by DG.