sortWith

Common
JS
Native
1.0
fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)

Sorts the array in-place according to the order specified by the given comparator.

Common
JS
Native
1.0
fun <T> MutableList<T>.sortWith(comparator: Comparator<in T>)

Sorts elements in the list in-place according to the order specified with comparator.

JVM
1.0
fun <T> Array<out T>.sortWith(comparator: Comparator<in T>)

Sorts the array in-place according to the order specified by the given comparator.

JVM
1.0
fun <T> Array<out T>.sortWith(
    comparator: Comparator<in T>,
    fromIndex: Int = 0,
    toIndex: Int = size)

Sorts a range in the array in-place with the given comparator.

JVM
1.0
fun <T> MutableList<T>.sortWith(comparator: Comparator<in T>)

Sorts elements in the list in-place according to the order specified with comparator.

Native
1.3
fun <T> Array<out T>.sortWith(
    comparator: Comparator<in T>,
    fromIndex: Int = 0,
    toIndex: Int = size)