minus

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Iterable<T>.minus(element: T): List<T>

Returns a list containing all elements of the original collection without the first occurrence of the given element.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Iterable<T>.minus(
    elements: Array<out T>
): List<T>

Returns a list containing all elements of the original collection except the elements contained in the given elements array.

Before Kotlin 1.6, the elements array may have been converted to a HashSet to speed up the operation, thus the elements were required to have a correct and stable implementation of hashCode() that didn't change between successive invocations. On JVM, you can enable this behavior back with the system property kotlin.collections.convert_arg_to_set_in_removeAll set to true.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Iterable<T>.minus(
    elements: Iterable<T>
): List<T>

Returns a list containing all elements of the original collection except the elements contained in the given elements collection.

Before Kotlin 1.6, the elements collection may have been converted to a HashSet to speed up the operation, thus the elements were required to have a correct and stable implementation of hashCode() that didn't change between successive invocations. On JVM, you can enable this behavior back with the system property kotlin.collections.convert_arg_to_set_in_removeAll set to true.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Iterable<T>.minus(
    elements: Sequence<T>
): List<T>

Returns a list containing all elements of the original collection except the elements contained in the given elements sequence.

Before Kotlin 1.6, the elements sequence may have been converted to a HashSet to speed up the operation, thus the elements were required to have a correct and stable implementation of hashCode() that didn't change between successive invocations. On JVM, you can enable this behavior back with the system property kotlin.collections.convert_arg_to_set_in_removeAll set to true.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Set<T>.minus(element: T): Set<T>

Returns a set containing all elements of the original set except the given element.

The returned set preserves the element iteration order of the original set.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Set<T>.minus(elements: Array<out T>): Set<T>

Returns a set containing all elements of the original set except the elements contained in the given elements array.

The returned set preserves the element iteration order of the original set.

Before Kotlin 1.6, the elements array may have been converted to a HashSet to speed up the operation, thus the elements were required to have a correct and stable implementation of hashCode() that didn't change between successive invocations. On JVM, you can enable this behavior back with the system property kotlin.collections.convert_arg_to_set_in_removeAll set to true.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Set<T>.minus(elements: Iterable<T>): Set<T>

Returns a set containing all elements of the original set except the elements contained in the given elements collection.

The returned set preserves the element iteration order of the original set.

Before Kotlin 1.6, the elements collection may have been converted to a HashSet to speed up the operation, thus the elements were required to have a correct and stable implementation of hashCode() that didn't change between successive invocations. On JVM, you can enable this behavior back with the system property kotlin.collections.convert_arg_to_set_in_removeAll set to true.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
operator fun <T> Set<T>.minus(elements: Sequence<T>): Set<T>

Returns a set containing all elements of the original set except the elements contained in the given elements sequence.

The returned set preserves the element iteration order of the original set.

Before Kotlin 1.6, the elements sequence may have been converted to a HashSet to speed up the operation, thus the elements were required to have a correct and stable implementation of hashCode() that didn't change between successive invocations. On JVM, you can enable this behavior back with the system property kotlin.collections.convert_arg_to_set_in_removeAll set to true.

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
operator fun <K, V> Map<out K, V>.minus(key: K): Map<K, V>

Returns a map containing all entries of the original map except the entry with the given key.

The returned map preserves the entry iteration order of the original map.

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
operator fun <K, V> Map<out K, V>.minus(
    keys: Iterable<K>
): Map<K, V>

Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys collection.

The returned map preserves the entry iteration order of the original map.

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
operator fun <K, V> Map<out K, V>.minus(
    keys: Array<out K>
): Map<K, V>

Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys array.

The returned map preserves the entry iteration order of the original map.

Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
operator fun <K, V> Map<out K, V>.minus(
    keys: Sequence<K>
): Map<K, V>

Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys sequence.

The returned map preserves the entry iteration order of the original map.

© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/minus.html