For my question, I have gone through this thread, but did not get help for my problem. I am using following line:
String[] result = s.split("\\",-1);
In my Date
class and calling:
Date date1 = new Date("20\01\2012");
But it does not work. I get an exception:
Exception in thread "main" java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
^
at java.util.regex.Pattern.error(Pattern.java:1924)
at java.util.regex.Pattern.compile(Pattern.java:1671)
at java.util.regex.Pattern.<init>(Pattern.java:1337)
at java.util.regex.Pattern.compile(Pattern.java:1022)
at java.lang.String.split(String.java:2313)
at Date.<init>(Date.java:84)
at Date.main(Date.java:279)