I have a simple problem with my json file.
That json file can describe like this:
{
"motto": "<span class="text-success">IF</span> YOU FAIL, TRY AGAIN"
}
How to put "
inside motto
property ? Thanks for advice
I have a simple problem with my json file.
That json file can describe like this:
{
"motto": "<span class="text-success">IF</span> YOU FAIL, TRY AGAIN"
}
How to put "
inside motto
property ? Thanks for advice
You can escape the inner double quotes around the class by using a \
like so;
{
"motto": "<span class=\"text-success\">IF</span> YOU FAIL, TRY AGAIN"
}
This will make it so the quotes immediately after the \
are seen as part of the string.
You just have to escape them:
{
"motto": "<span class=\"text-success\">IF</span> YOU FAIL, TRY AGAIN"
}
just one backslash ( \ ) in front of quotes.
It's as easy as pie. Just escape your inner quotation marks with a backslash. So, your example will look like:
{
"motto": "<span class=\"text-success\">IF</span> YOU FAIL, TRY AGAIN"
}