Kotlin HashSet subtract()
Syntax & Examples


Syntax of HashSet.subtract()

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

infix fun <T> Iterable<T>.subtract( other: Iterable<T> ): Set<T>

This subtract() extension function of HashSet returns a set containing all elements that are contained by this collection and not contained by the specified collection.