I have a map:
Map(\"key1\" -> Some(\"value1\"), \"key2\" -> None, \"key3\" -> Some(\"value3\"))
I want to remove all None
None
My take using for comprehensions:
val m = Map("key1" -> Some("value1"), "key2" -> None, "key3" -> Some("value3")) for( (key,value) <- m if(value.isDefined)) yield (key,value.get)