Kotlin HashSet toSet()
Syntax & Examples


Syntax of HashSet.toSet()

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

fun <T> Iterable<T>.toSet(): Set<T>

This toSet() extension function of HashSet returns a Set of all elements.