I have a url in this format:
http:\\/\\/example.example.ru\\/u82651140\\/audio\\/song.mp3
How can I remove the extra \"\\\"s from the string? I
Try
str = str.replace(/\\/g, '');
Try:
string.replace(/\\\//g, "/");
This will specifically match the "\/" pattern so that you don't unintentionally remove any other backslashes that there may be in the URL (e.g. in the hash part).
from: http://knowledge-serve.blogspot.com/2012/08/javascript-remove-all-backslash-from.html
function replaceAllBackSlash(targetStr){
var index=targetStr.indexOf("\\");
while(index >= 0){
targetStr=targetStr.replace("\\","");
index=targetStr.indexOf("\\");
}
return targetStr;
}