Reputation: 5168
I have a string that I get from a database with has many backslashes in. I need to take them all out. I have been playing with the .replace function however because there is an undefined number of backslashes I can't work out how to do it.
Any help is much appreicated.
Upvotes: 0
Views: 71
Reputation: 16051
try :
var str = 'str //// str';
str = str.replace(/\//g,''); // edited to match the comment of jiduvah
Upvotes: 1