distinct

fun <T> Array<out T>.distinct(): List<T>(source)

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

Among equal elements of the given array, only the first one will be present in the resulting list. The elements in the resulting list are in the same order as they were in the source array.

Since Kotlin

1.0

Samples


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.

Since Kotlin

1.0

Samples


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

Among equal elements of the given collection, only the first one will be present in the resulting list. The elements in the resulting list are in the same order as they were in the source collection.

Since Kotlin

1.0

Samples