I know that "[" brackets are used in json to specify a list such as: "Value":["A","B"]
However I want to use those brackets as is in json like "Value":"[A TO B]" since in the future this json string gets mapped to a URL:
I am using java where while using json parser it gives me an error. Is there a way I can escape "[" brackets.
As long as you keep it in quotes, it is valid JSON. Try the code below in a validator
{
"key": "mykey",
"Value": "[A TO B]"
}
It returns: valid!
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