JavaScript: Remove all backslash (\) from a String in JavaScript
How to remove all backslash (\) from a String in JavaScript
Solution:
function replaceAllBackSlash(targetStr){
var index=targetStr.indexOf("\\");
while(index >= 0){
targetStr=targetStr.replace("\\","");
index=targetStr.indexOf("\\");
}
return targetStr;
}
Solution:
function replaceAllBackSlash(targetStr){
var index=targetStr.indexOf("\\");
while(index >= 0){
targetStr=targetStr.replace("\\","");
index=targetStr.indexOf("\\");
}
return targetStr;
}
Very helpful. Thanks!
ReplyDelete