I'm just trying to replace a string \\ with \\\\
Below is the program but it is terminating
String path="\\dctmadmin\\Human Resource\\Training\\Procedures\\Formalities\\Legalities\\Material";
long start = System.currentTimeMillis();
// replace this string \\ with \\\\
String formatedPath = path.replaceAll("\\\\", "\\\\\\\\");
System.out.println(" string after formatting using replaceAll = "+formatedPath);
long end = System.currentTimeMillis();
System.out.println(" time take in milli seconds for String.replaceAll = "+Long.toString(end-start) );
Please let me know the mistake i was doing.
Long.toString(end-start)is not neccessary.(end-start)will suffice.