Skip to content

Instantly share code, notes, and snippets.

@devth
Last active December 19, 2015 20:48
Show Gist options
  • Save devth/6015300 to your computer and use it in GitHub Desktop.
Save devth/6015300 to your computer and use it in GitHub Desktop.
"abc/xyz.lol" split("/").reduceLeft((a, b) => b) // => Array[String] = Array(abc, xyz.lol)
"abc/xyz.lol" split("/") reduceLeft((a, b) => b) // => String = xyz.lol
"abc/xyz.lol".split("/").reduceLeft((a, b) => b) // => String = xyz.lol
// Why does the first line result in the full Array?
@devth
Copy link
Author

devth commented Jul 16, 2013

answer: "without the dot it's parsed as "abc/xyz.lol" split(("/").reduceLeft((a, b) => b))" - tpolecat in #scala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment