Ayfri
02/09/2022, 10:13 PMlist.sortedBy { it }
, for a list of strings or numbers ? I know it's already pretty short but the fact that there's only it
in the lambda feels kinda wrongJoffrey
02/09/2022, 10:14 PMlist.sorted()
š it's available not only for lists of integers but of any Comparable
(see doc)ephemient
02/09/2022, 10:15 PMlist.sortedWith(Comparator.getInstance())
if you want locale-sensitive string sortingAyfri
02/09/2022, 11:38 PM