Kotlin HashSet toHashSet()
Syntax & Examples


Syntax of toHashSet()

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

fun <T> Iterable<T>.toHashSet(): HashSet<T>

This toHashSet() extension function of HashSet returns a new HashSet of all elements.