sorted
fun <T : Comparable<T>> Array<out T>.sorted(): List<T>
fun <T : Comparable<T>> Iterable<T>.sorted(): List<T>
Returns a list of all elements sorted according to their natural sort order.
The sort is stable. It means that equal elements preserve their order relative to each other after sorting.
fun ShortArray.sorted(): List<Short>
fun FloatArray.sorted(): List<Float>
fun DoubleArray.sorted(): List<Double>
@ExperimentalUnsignedTypes fun ULongArray.sorted(): List<ULong>
@ExperimentalUnsignedTypes fun UByteArray.sorted(): List<UByte>
@ExperimentalUnsignedTypes fun UShortArray.sorted(): List<UShort>
Returns a list of all elements sorted according to their natural sort order.