Skip to content

Instantly share code, notes, and snippets.

@Solid-Color-Labs
Created November 23, 2018 14:31
Show Gist options
  • Save Solid-Color-Labs/fae6627ce9793379e1c91e8e978dd278 to your computer and use it in GitHub Desktop.
Save Solid-Color-Labs/fae6627ce9793379e1c91e8e978dd278 to your computer and use it in GitHub Desktop.
def main(args: Array[String]): Unit = {
val myMap = Map("int" -> 1, "double" -> 2.5, "string" -> "my string")
val mappedMap = myMap.mapValues {
case s: String => Option(s).getOrElse("")
// case b: Boolean => Option.fold()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment