W3cubDocs

/Kotlin

sortWith

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

Platform and version requirements: JVM

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

Platform and version requirements: JS

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

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

Platform and version requirements: JVM

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

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

Platform and version requirements: JVM

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

Platform and version requirements: JS

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

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