In Scala, it's just the map
function. For example, if hashMap is a hashMap of strings, then you can do the following:
val result : HashMap[String,String] = hashMap.map(case(k,v) => (k -> v.toUpperCase))
In Kotlin, however, map
turns the map into a list. Is there an idiomatic way of doing the same thing in Kotlin?