Remove Quotes From A String Using JavaScript

If you ever need to strip out quotes from a string, here is a handy Regular Expression. This will remove any single or double quotes from the var str.

function delquote(str){return (str=str.replace(/[“‘]{1}/gi,””));}

 

Example:

str=”My string’s really “quoted”, eh?;

delquote(str); // returns My strings really quoted, eh?

Leave a Reply