groupingBy

inline fun <T, K> Sequence<T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>(source)

Creates a Grouping source from a sequence to be used later with one of group-and-fold operations using the specified keySelector function to extract a key from each element.

The operation is intermediate and stateless.

Since Kotlin

1.1

Samples