Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. val col = Map("a" -> "Apple", "b" -> "Bag", "c" -> "Cat")
  2. val seq = Array("a", "c")
  3. seq.map(e => col.get(e) match { case Some(item) => item }) // => Array("Apple", "Cat")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement