Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.94 KB

Assorted.Utils.Collections.EnumerableExtensions.Partition.md

File metadata and controls

53 lines (34 loc) · 1.94 KB

EnumerableExtensions.Partition<TSource>(this IEnumerable<TSource>, int) Method

Namespace: Assorted.Utils.Collections
Assembly: Assorted.Utils (Assorted.Utils.dll) version 1.1.0.0

Splits the sequence into a fixed-size chunks.

Syntax

public static IEnumerable<IEnumerable<TSource>> Partition<TSource>(
    this IEnumerable<TSource> source, 
    int size
)

Type Parameters

TSource
The type of elements in the source.

Parameters

source: IEnumerable<TSource>
A sequence of values.

size: int
The size of each chunk.

Return Value

IEnumerable<IEnumerable<TSource>>
An System.Collections.Generic.IEnumerable<T> where each of its elements are also an System.Collections.Generic.IEnumerable<T>.

Exceptions

Exception Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException size is zero or negative.

Remarks

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.

See Also


This document is generated by DG.