Kotlin HashSet toCollection()
Syntax & Examples


Syntax of HashSet.toCollection()

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

fun <T, C : MutableCollection<in T>> Iterable<T>.toCollection( destination: C ): C

This toCollection() extension function of HashSet appends all elements to the given destination collection.