Sorted

This function sorts the collection by their natural sort order. It can only be called if the generic type parameter implements the Comparable<T> interface:

val numbers = listOf(2, 1, 5, 3, 4)
val sorted = numbers.sorted()
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.44.108