в Множество
Впервые в Kotlin: 1.0
fun <T> Array<out T>.toSet(): Set<T>
fun ByteArray.toSet(): Set<Byte>
fun ShortArray.toSet(): Set<Short>
fun IntArray.toSet(): Set<Int>
fun LongArray.toSet(): Set<Long>
fun FloatArray.toSet(): Set<Float>
fun DoubleArray.toSet(): Set<Double>
fun BooleanArray.toSet(): Set<Boolean>
fun CharArray.toSet(): Set<Char>
Возвращает множество всех элементов.
Возвращаемое множество сохраняет порядок перебора элементов исходного массива.
fun <T> Iterable<T>.toSet(): Set<T>
Возвращает множество всех элементов.
Возвращаемое множество сохраняет порядок перебора элементов исходной коллекции.
© 2010–2026 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/to-set.html