Kotlin HashSet minus()
Syntax & Examples


Syntax of HashSet.minus()

There are 8 variations for the syntax of HashSet.minus() extension function. They are:

1.
operator fun <T> Iterable<T>.minus(element: T): List<T>

This extension function returns a list containing all elements of the original collection without the first occurrence of the given element.

2.
operator fun <T> Iterable<T>.minus( elements: Array<out T> ): List<T>

This extension function returns a list containing all elements of the original collection except the elements contained in the given elements array.

3.
operator fun <T> Iterable<T>.minus( elements: Iterable<T> ): List<T>

This extension function returns a list containing all elements of the original collection except the elements contained in the given elements collection.

4.
operator fun <T> Iterable<T>.minus( elements: Sequence<T> ): List<T>

This extension function returns a list containing all elements of the original collection except the elements contained in the given elements sequence.

5.
operator fun <T> Set<T>.minus(element: T): Set<T>

This extension function returns a set containing all elements of the original set except the given element.

6.
operator fun <T> Set<T>.minus(elements: Array<out T>): Set<T>

This extension function returns a set containing all elements of the original set except the elements contained in the given elements array.

7.
operator fun <T> Set<T>.minus(elements: Iterable<T>): Set<T>

This extension function returns a set containing all elements of the original set except the elements contained in the given elements collection.

8.
operator fun <T> Set<T>.minus(elements: Sequence<T>): Set<T>

This extension function returns a set containing all elements of the original set except the elements contained in the given elements sequence.