M_CommandLine_Infrastructure_EnumerableExtensions_Group__1 - adutton/commandline GitHub Wiki
Breaks a collection into groups of a specified size.
Namespace: CommandLine.Infrastructure
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
public static IEnumerable<T[]> Group<T>(
this IEnumerable<T> source,
int groupSize
)VB
<ExtensionAttribute>
Public Shared Function Group(Of T) (
source As IEnumerable(Of T),
groupSize As Integer
) As IEnumerable(Of T())C++
public:
[ExtensionAttribute]
generic<typename T>
static IEnumerable<array<T>^>^ Group(
IEnumerable<T>^ source,
int groupSize
)F#
[<ExtensionAttribute>]
static member Group :
source : IEnumerable<'T> *
groupSize : int -> IEnumerable<'T[]>
- source
- Type: System.Collections.Generic.IEnumerable(T)
A collection of . - groupSize
- Type: System.Int32
The number of items each group shall contain.
- T
Type: IEnumerable(T[])
An enumeration of T[].
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(T). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
An incomplete group at the end of the source collection will be silently dropped.
EnumerableExtensions Class
CommandLine.Infrastructure Namespace