W3cubDocs

/Kotlin

distinct

fun <T> Array<out T>.distinct(): List<T>
fun ByteArray.distinct(): List<Byte>
fun ShortArray.distinct(): List<Short>
fun IntArray.distinct(): List<Int>
fun LongArray.distinct(): List<Long>
fun FloatArray.distinct(): List<Float>
fun DoubleArray.distinct(): List<Double>
fun BooleanArray.distinct(): List<Boolean>
fun CharArray.distinct(): List<Char>

Returns a list containing only distinct elements from the given array.

The elements in the resulting list are in the same order as they were in the source array.

fun <T> Iterable<T>.distinct(): List<T>

Returns a list containing only distinct elements from the given collection.

The elements in the resulting list are in the same order as they were in the source collection.

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