I have a map where the key is a String and I need to change every key to lower case before work with this map.
How can I do it in Scala? I was thinking something lik
Your approach would work, but in general in Scala for this kind of transformation the immutable variants of the collections are preferred.
You can use the map method of the Map class with the following one liner:
val m = Map("a"->"A", "B"->"b1", "b"->"B2", "C"->"c")
m.map(e=>(e._1.toLowerCase,e._2))