I have a String representing a directory, where \\ is used to separate folders. I want to split based on \"\\\\\":
\\
\"\\\\\"
String address = \"C
You need to use \\\\ instead of \\.
\\\\
The backslash(\) is an escape character in Java Strings.If you want to use backslash as a literal you have to type \\\\ ,as \ is also a escape character in regular expressions.
For more details click here