supaham
07/03/2016, 3:30 PMmap.toSortedMap(compareBy<String> { it.length }.thenBy { it })
Which sorts the map by the string length, and then by the string contents. Simply, when you say thenBy { it }
it says use the compare method provided in it
(it being the String class)
See: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.comparisons/compare-by.html