The tab character (U+0009), carriage return (U+000D), line feed (U+000A), and space (U+0020) characters are the only valid whitespace characters in JSON.
A simple ' ' (space character) is enough to do what is needed, the json key does hold a string after all, if you need something more prominent you can use '\t', refer here for more.
You can use \u0020 to escape the ' ' character in JSON.
In computer programming, whitespace is any character or series of characters that represent horizontal or vertical space in typography. When rendered, a whitespace character does not correspond to a visible mark, but typically does occupy an area on a page.
JSON specifies that "Whitespace can be inserted between any pair of tokens." What it does not specify is exactly what whitespace is. Should I read this as "old-fashioned ASCII whitespace" or "the entire spectrum of Unicode whitespace"?
In other words, when parsing JSON, are U+2000, U+2001, U+FEFF etc. valid whitespace characters between tokens?
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