How do I add quotation marks to a JSON Object attributes for example like this:
{name:"User 01"}
so it should look like that afterward:
{"name":"User 01"}
both of them are strings
Assuming the first example is a Javascript object, you could convert it into a JSON string using JSON.stringify:
JSON.stringify({name:"User 01"});
outputs: "{"name":"User 01"}"
If the first example is a string, I think you would have to parse through it with methods like split.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With