Answers for "kotlin sortby"

0

kotlin sortedby

val list = arrayOf("abc", "d", "efghi", "jklm")
val sorted = list.sortedBy { it.length } //sort by length ascending

//sorted: ["d", "abc", "jklm", "efghi"]
Posted by: Guest on August-04-2021

Browse Popular Code Answers by Language