-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Collections_EnumerableExtensions_GroupWhileEquals__2
Andrew Koryavchenko edited this page Jun 17, 2018
·
2 revisions
Groups items in the sequence while they have same grouping key.
Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static IEnumerable<IGrouping<TKey, T>> GroupWhileEquals<T, TKey>(
this IEnumerable<T> source,
Func<T, TKey> keySelector
)
VB
<ExtensionAttribute>
Public Shared Function GroupWhileEquals(Of T, TKey) (
source As IEnumerable(Of T),
keySelector As Func(Of T, TKey)
) As IEnumerable(Of IGrouping(Of TKey, T))
F#
[<ExtensionAttribute>]
static member GroupWhileEquals :
source : IEnumerable<'T> *
keySelector : Func<'T, 'TKey> -> IEnumerable<IGrouping<'TKey, 'T>>
- source
- Type: System.Collections.Generic.IEnumerable(T)
The source. - keySelector
- Type: System.Func(T, TKey)
The grouping key selector.
- T
- Type of items in sequence
- TKey
- The type of the grouping key.
Type: IEnumerable(IGrouping(TKey, T))
Grouped items with grouping key.
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).
EnumerableExtensions Class
GroupWhileEquals Overload
CodeJam.Collections Namespace