how to remove key value from map in scala
If you use immutable maps, you can use the – method to create a new map without the given key: val mx = Map(“data” -> “sumi”, “rel” -> 2, “privacy” -> 0) val m = mx(“privacy”) match { case 0 => mx – “data” case _ => mx } => m: scala.collection.immutable.Map[String,Any] = Map(rel -> … Read more