I have a Map[String,String] and I would like to print it in a particular order depending on the keys. For example I would like to print the value of id, name, address. So I would like to match my keys to "id","name", "address" and then print the values at each of these keys. I have the following code but it doesn't work:
articlesmap.keys match{
case ("id") => println(articlesmap.get("id"))
case ("name") => println(articlesmap.get("name"))
case ("address") => println(articlesmap.get("address"))
}
printlnstatements?keysof the map, which is aIterator[String]; that is the exact reason you're not getting the expected result.