sortedByDescending

Common
JVM
JS
Native
1.0
inline fun <T, R : Comparable<R>> Array<out T>.sortedByDescending(
    crossinline selector: (T) -> R?
): List<T>

(source)
inline fun <T, R : Comparable<R>> Iterable<T>.sortedByDescending(
    crossinline selector: (T) -> R?
): List<T>

(source)

Returns a list of all elements sorted descending according to natural sort order of the value returned by specified selector function.

The sort is stable. It means that equal elements preserve their order relative to each other after sorting.

Common
JVM
JS
Native
1.0
inline fun <R : Comparable<R>> ByteArray.sortedByDescending(
    crossinline selector: (Byte) -> R?
): List<Byte>

(source)
inline fun <R : Comparable<R>> ShortArray.sortedByDescending(
    crossinline selector: (Short) -> R?
): List<Short>

(source)
inline fun <R : Comparable<R>> IntArray.sortedByDescending(
    crossinline selector: (Int) -> R?
): List<Int>

(source)
inline fun <R : Comparable<R>> LongArray.sortedByDescending(
    crossinline selector: (Long) -> R?
): List<Long>

(source)
inline fun <R : Comparable<R>> FloatArray.sortedByDescending(
    crossinline selector: (Float) -> R?
): List<Float>

(source)
inline fun <R : Comparable<R>> DoubleArray.sortedByDescending(
    crossinline selector: (Double) -> R?
): List<Double>

(source)
inline fun <R : Comparable<R>> BooleanArray.sortedByDescending(
    crossinline selector: (Boolean) -> R?
): List<Boolean>

(source)
inline fun <R : Comparable<R>> CharArray.sortedByDescending(
    crossinline selector: (Char) -> R?
): List<Char>

(source)

Returns a list of all elements sorted descending according to natural sort order of the value returned by specified selector function.