I'm working in a javascript function, in a given string I need to replace //
for only one slash /
by now I have:
result= mystring.replace("\/\/", "/");
bt it's not working, I still get the string with double slash, so which is the proper regex to indicate the double slash to the replace function?
I already tried:
- !//!
- ////
- ///g///g
Edit:
I'm using it to correct a URL that is saved in the string, for example,
sometimes that URL can be something like: mywebpage/someparameter//someotherparameter
and that double slash gives problem, so I need to replace it to one single slash like: mywebpage/someparameter/someotherparameter