Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

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

Declaration

public static IEnumerable<ConsecutiveGroup<TItem, TItem>> GroupConsecutive<TItem>(
    this IEnumerable<TItem> source,
    Func<TItem, TItem, bool> itemEquality
)

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.
Func<TItem, TItem, bool>itemEquality An optional function to determine equality of items.

Returns

A collection containing each sequence of consecutive equal elements.