sortedWith

fun <T> Iterable<T>.sortedWith(vararg selectors: (T) -> Comparable<*>): List<T>
fun <T> Sequence<T>.sortedWith(vararg selectors: (T) -> Comparable<*>): Sequence<T>

Returns a list of all elements sorted according to the specified selectors.

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

Sources

Link copied to clipboard
Link copied to clipboard