in Javascript, I am having some trouble replacing ‘/’ with ‘/’ in a string. I tried this
string.replaceAll("\\/","/"));
What’s wrong with this ? I am escaping the escape character i.e. the backslash.
Please advise. Thanks
Edit: I have an escaped URL such as http://www.gogobeans.com. I need to change this to http://www.gogobeans.com
I’ve never heard of
replaceAllmethod in pure javascript, tryreplacewith a regex:I’ve escaped the escape character with
\\then escaped the scope character/, it should work.JSFiddle: DEMO