Skip to content

Instantly share code, notes, and snippets.

@ryoppy
Created January 13, 2015 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryoppy/2119aad67563153bf225 to your computer and use it in GitHub Desktop.
Save ryoppy/2119aad67563153bf225 to your computer and use it in GitHub Desktop.
scala> val size = "300x250"
size: String = 300x250
scala> val Array(w, h) = size split "x" map (_.toInt)
w: Int = 300
h: Int = 250
scala> val Array(w, h, z) = size split "x" map (_.toInt)
scala.MatchError: [I@606d6d2c (of class [I)
... 33 elided
scala> val Array(w) = size split "x" map (_.toInt)
scala.MatchError: [I@365e65bb (of class [I)
... 33 elided
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment