Last active
December 19, 2015 20:48
-
-
Save devth/6015300 to your computer and use it in GitHub Desktop.
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
"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? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
answer: "without the dot it's parsed as "abc/xyz.lol" split(("/").reduceLeft((a, b) => b))" - tpolecat in #scala