Answers for "sort list of custom objects by field in kotlin"

1

sort custom object list in kotlin

val messages = mutableListOf<Message>(
                Message(from = "Tonnie", messageString = "Hi", timestamp = Date()),
                Message(from = "Victoria", messageString = "Miss You", timestamp = Date()))
                 messages.sortWith(compareBy { it.timestamp })
Posted by: Guest on October-24-2020

Code answers related to "sort list of custom objects by field in kotlin"

Browse Popular Code Answers by Language