Kotlin HashSet groupingBy()
Syntax & Examples


Syntax of HashSet.groupingBy()

The syntax of HashSet.groupingBy() extension function is:

fun <T, K> Iterable<T>.groupingBy( keySelector: (T) -> K ): Grouping<T, K>

This groupingBy() extension function of HashSet creates a Grouping source from a collection to be used later with one of group-and-fold operations using the specified keySelector function to extract a key from each element.