Kotlin HashSet count()
Syntax & Examples


Syntax of HashSet.count()

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

fun <T> Iterable<T>.count(predicate: (T) -> Boolean): Int

This count() extension function of HashSet returns the number of elements matching the given predicate.