-
Notifications
You must be signed in to change notification settings - Fork 36
M_CodeJam_Collections_EnumerableExtensions_GroupWhileEquals__2_1
Andrew Koryavchenko edited this page Jun 17, 2018
·
2 revisions
EnumerableExtensions.GroupWhileEquals(T, TKey) Method (IEnumerable(T), Func(T, TKey), IEqualityComparer(TKey))
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,
IEqualityComparer<TKey> comparer
)
VB
<ExtensionAttribute>
Public Shared Function GroupWhileEquals(Of T, TKey) (
source As IEnumerable(Of T),
keySelector As Func(Of T, TKey),
comparer As IEqualityComparer(Of TKey)
) As IEnumerable(Of IGrouping(Of TKey, T))
F#
[<ExtensionAttribute>]
static member GroupWhileEquals :
source : IEnumerable<'T> *
keySelector : Func<'T, 'TKey> *
comparer : IEqualityComparer<'TKey> -> IEnumerable<IGrouping<'TKey, 'T>>
- source
- Type: System.Collections.Generic.IEnumerable(T)
The source. - keySelector
- Type: System.Func(T, TKey)
The grouping key selector. - comparer
- Type: System.Collections.Generic.IEqualityComparer(TKey)
The comparer.
- 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