matt tighe
09/26/2018, 7:41 PMHashMap
and sort it by its keys, but i only really care about having a specific key at the beginning, the rest of them don’t matter. something like
val myHashMap = HashMap<String, Int>
myHashMap.put("hello", 0)
myHashMap.put("world", 1)
val sorted = myHashMap.toSortedMap(compareBy { it == "world" })
can anyone help me figure out how to do that?Dominaezzz
09/26/2018, 8:03 PMLinkedHashMap
will do the trick.Ol' Dawg
09/26/2018, 8:22 PM