Created
January 16, 2013 23:09
-
-
Save krishnanraman/4551886 to your computer and use it in GitHub Desktop.
First key that maps to a value in a scala map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scala> val m = Map(1->"one",2->"one",3->"two") | |
| scala> m.filter(pair=>pair._2 == "one").head._1 | |
| res32: Int = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment