Skip to content

Instantly share code, notes, and snippets.

@shigemk2 shigemk2/case.scala
Created Feb 11, 2015

Embed
What would you like to do?
val i = 5
i match {
case a if 0 to 9 contains a => println("0-9 range: " + a)
case b if 10 to 19 contains b => println("10-19 range: " + b)
case c if 20 to 29 contains c => println("20-29 range: " + c)
case _ => println("Hmmm...")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.