How do I replace \" with \\\".
Here is what im trying :
def main(args:Array[String]) = { val line:String = \"replace \\\" quote\"; println
Use "replaceAllLiterally" method of StringOps class. This replaces all literal occurrences of the argument:
scala> val line:String = "replace \" quote" line: String = replace " quote scala> line.replaceAllLiterally("\"", "\\\"") res8: String = replace \" quote