You can try using regex to remove quotes from your string
var strWithOutQuotes= strWithQuotes.replace(/['"]+/g, '')
"to only match double quotes.
Above solution will remove double quotes from your string.
If you just want to remove double quotes from start and end of you string you can try
var strWithOutQuotes= strWithQuotes.replace(/^"(.*)"$/, '$1');
Another way, possible the simplest example
var strWithOutQuotes= strWithQuotes.replace(/"/g, '');
here is the working fiddle of the last solution.
If you want to remove the double quotes from JSON returned data, you can simply remove it using JSON.Parse method like below
JSON.parse(Double_quoted_string); JSON.parse("My test"); // for example
You can also do it using eval
var No_Quotes_string= eval(Quoted_string);
You can also simply use to remove all double quotes (")
str = str.replace(/"/g,"");
If you want to remove only quotes around the string, you can use:
var str = '"Your "quoted" string"'; console.log( clean = str.replace(/^"|"$/g, '') ); //Your "quoted" string
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly