IndexOf<>(source, predicate, startIndex) IndexOf<>(source, element, comparer) JoinString<>(values, separator, prefix, suffix, lastSeparator) Order<>(source, comparer) SkipLast<>(source, count, throwIfNotEnough) Split<>(splitWhat, splitWhere) Split<>(source, chunkSize) ToDictionary2<>(source, key1Selector, key2Selector, comparer1, comparer2) ToDictionary2<>(source, key1Selector, key2Selector, elementSelector, comparer1, comparer2)
Legend Class Struct Enum Interface Delegate | Constructor Method Property Event Field |
| Extension method: IEnumerable<ConsecutiveGroup<TItem, TKey>> GroupConsecutiveBy<TItem, TKey>(this IEnumerable<TItem>, Func<TItem, TKey>, IEqualityComparer<TKey>)Declarationpublic static IEnumerable<ConsecutiveGroup<TItem, TKey>> GroupConsecutiveBy<TItem, TKey>(
this IEnumerable<TItem> source,
Func<TItem, TKey> selector,
IEqualityComparer<TKey> keyComparer = null
) Summary
Accumulates consecutive elements that are equal when processed by a selector. Generic type parametersTItem |
The type of items in the input sequence. | TKey |
The return type of the selector function. |
Parametersthis IEnumerable<TItem> | source |
The input sequence from which to accumulate groups of consecutive elements. | Func<TItem, TKey> | selector |
A function to transform each item into a key which is compared for equality. | IEqualityComparer<TKey> | keyComparer |
An optional equality comparer for the keys returned by selector. |
Returns
A collection containing each sequence of consecutive equal elements. |