Skip to content

Instantly share code, notes, and snippets.

View raj638111's full-sized avatar

Rajkumar Gunasekaran raj638111

View GitHub Profile
@raj638111
raj638111 / split.scala
Last active April 28, 2016 17:49
A Gist about split() method
/************************************************************
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")