W3cubDocs

/Kotlin

intersect

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
infix fun <T> Array<out T>.intersect(
    other: Iterable<T>
): Set<T>
infix fun ByteArray.intersect(
    other: Iterable<Byte>
): Set<Byte>
infix fun ShortArray.intersect(
    other: Iterable<Short>
): Set<Short>
infix fun IntArray.intersect(other: Iterable<Int>): Set<Int>
infix fun LongArray.intersect(
    other: Iterable<Long>
): Set<Long>
infix fun FloatArray.intersect(
    other: Iterable<Float>
): Set<Float>
infix fun DoubleArray.intersect(
    other: Iterable<Double>
): Set<Double>
infix fun BooleanArray.intersect(
    other: Iterable<Boolean>
): Set<Boolean>
infix fun CharArray.intersect(
    other: Iterable<Char>
): Set<Char>

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

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

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
infix fun <T> Iterable<T>.intersect(
    other: Iterable<T>
): Set<T>

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

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

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