Search code examples
javascriptjsonreactjsjsxdouble-quotes

How do I remove double quote "" from JSON Value


I am doing my Javascript. And just imported JSON and printed it out with JSON.stringfy I am using that site because the JSON contains the URL which I want to link. I am not getting what I really need as the output.

description": "www.site.com" 

This is what I get in my console:

"www.site.com"

This is what I actually want, and remove the quotes.

www.site.com

Please help!


Solution

  • Am not sure what your requirement is but you can do this. Try Replace function;

    const obj = {description: "www.site.com"};
    JSON.stringify(obj.description).replace(/"/g,"");