Posted By:
Robert_Lybarger
Posted On:
Tuesday, December 11, 2007 08:45 AM
To elaborate slightly more, the "" is meaningful to a regex as an escape character. A literal version of a special character must be escaped, in this case as "\". But when you then write it in Java code as a String literal, the "" is meaningful there (also as an escape character) so they must each be escaped again to "\\".
Posted By:
Anonymous
Posted On:
Tuesday, December 11, 2007 03:49 AM
you can set
System.out.println(f.getAbsolutePath().replaceAll("\\", "/"));
because '\' is special character on regular expression