Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: IEnumerable<ConsecutiveGroup<TItem, TItem>> GroupConsecutive<TItem>(this IEnumerable<TItem>, IEqualityComparer<TItem>)

Declaration

public static IEnumerable<ConsecutiveGroup<TItem, TItem>> GroupConsecutive<TItem>(
    this IEnumerable<TItem> source,
    IEqualityComparer<TItem> itemComparer = null
)

Summary

Accumulates consecutive equal elements.

Generic type parameters

TItem The type of items in the input sequence.

Parameters

this IEnumerable<TItem>source The input sequence from which to accumulate groups of consecutive elements.
IEqualityComparer<TItem>itemComparer An optional equality comparer to determine item equality by.

Returns

A collection containing each sequence of consecutive equal elements.