how to split the string in java in Windows? I used Eg.
String directory=\"C:\\home\\public\\folder\";
String [] dir=direct.split(\"\\\");
The syntax error is caused because the sing backslash is used as escape character in Java.
In the Regex '\' is also a escape character that why you need escape from it either.
As the final result should look like this "\\\\".
But You should use the java.io.File.separator as the split character in a path.
String[] dirs = dircect.split(Pattern.quote(File.separator));
thx to John