-7

I need to replace the string "\" with "/" I tried

myString.replace("\","/");

but it's kind of syntax it says

String literal is not properly closed by a double-quote

how can i do it ?

1 Answers1

4

Escape back slash like:

myString.replace("\\","/");
SMA
  • 36,381
  • 8
  • 49
  • 73