Search code examples
javaandroideclipsereplacereplaceall

Replace string \ with / android


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 ?


Solution

  • Escape back slash like:

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