Last active
April 28, 2016 17:49
-
-
Save raj638111/98ba74c89ec8e2482ff06e0c0d5fb434 to your computer and use it in GitHub Desktop.
A Gist about split() method
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
/************************************************************ | |
Split a string with a delimiter of || | |
************************************************************/ | |
scala> val line = "This is a line || line" | |
line: String = This is a line || line | |
// http://stackoverflow.com/questions/9808689/why-does-string-split-need-pipe-delimiter-to-be-escaped | |
scala> line.split("\\|\\|") | |
res6: Array[String] = Array("This is a line ", " line") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment