https://kotlinlang.org logo
s

sylcn

04/12/2018, 7:41 AM
Hi Guys, I have to sort an item of Custom object. Its values like :
9 A - 11 -  9 - 11 B
how can I make it to be
9 - 9 A - 11 - 11 B
I want to make with code below but I am could not afford it. The trouble is sorting array items with number aware format.
Copy code
//result is list 
//'it' is CustomObject its name is DoorItem. Obejcts properties are id, name, doorNumber
result.sortedWith(compareBy {it.doorNumber})