I have a file path like this
\\ptrisf02\group\Corrolog\Other\Newfolder\SecurityTest\EV10222-01\FinalPack\REP WI\3101384589-(PN-5A1662).pdf
I want to replace \\
to \\\\
and \
to \\
. I wrote this code for it
String r_Docpath=Docpath.replace('\\', '\\\\');
But it gives Invalid character constant error. How can I made it correctly?
I solved the problem like this codes;
String r_Docpath=Docpath.replace("\"", "\\\"");
String r2_Docpath=r_Docpath.replace("\\", "\\\\\"");