I am trying to sort this: listOf("P5","P1","P2","P3","P10") by using val list = categoryList.sortedBy { it } but what is returning is this: [P1, P10, P2, P3, P5] , according to my requirement it should return [P1, P2, P3, P5, P10] so what i am doing wrong here?