Reputation: 39
how to replace ( /" or /') to ( " or ') from the string in javascript. I am referring the content inside the braces. Could anyone give me regular expression for that. Thanks
Upvotes: 4
Views: 124
Reputation: 700382
You can use one regular expression to replace both:
str = str.replace(/\/(['"])/g, '$1');
Upvotes: 4