I have a String representing a directory, where \\ is used to separate folders. I want to split based on \"\\\\\":
\\
\"\\\\\"
String address = \"C
Use separators:
String address = "C:\saeed\test"; String[] splited = address.split(System.getProperty("file.separator"));