W3cubDocs

/Kotlin

subtract

infix fun <T> Array<out T>.subtract(
    other: Iterable<T>
): Set<T>
infix fun ByteArray.subtract(
    other: Iterable<Byte>
): Set<Byte>
infix fun ShortArray.subtract(
    other: Iterable<Short>
): Set<Short>
infix fun IntArray.subtract(other: Iterable<Int>): Set<Int>
infix fun LongArray.subtract(
    other: Iterable<Long>
): Set<Long>
infix fun FloatArray.subtract(
    other: Iterable<Float>
): Set<Float>
infix fun DoubleArray.subtract(
    other: Iterable<Double>
): Set<Double>
infix fun BooleanArray.subtract(
    other: Iterable<Boolean>
): Set<Boolean>
infix fun CharArray.subtract(
    other: Iterable<Char>
): Set<Char>

Returns a set containing all elements that are contained by this array and not contained by the specified collection.

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

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

Returns a set containing all elements that are contained by this collection and not contained by the specified collection.

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

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/subtract.html