<< Back to the snippet list

Replace apostophes in javascript using RegEx

Published: 30 Dec 2009 By Sonu Kapoor

The other day I needed to replace some apostrophes in javascript. We can use standard string.replace("'", "");, however this will replace only the first occurrence, therefore a regex is the best solution.

apostrophes replace javascript regex

Please login to leave a comment.