how to split the string in java in Windows?
I used
Eg.
String directory="C:\home\public\folder";
String [] dir=direct.split("\");
I want to know how to split the string in eg.
In java, if I use "split("\")" , there is syntax error.
thanks
split()function in Java accepts regular expressions. So, what you exactly need to do is to escape the backslash character twice:One for Java, and one for regular expressions.