Are blank characters like spaces, tabs and carriage returns ignored in json strings?
For example, is {"a":"b"}
equal to {"a" : "b"}
?
Are blank characters like spaces, tabs and carriage returns ignored in json strings?
For example, is {"a":"b"}
equal to {"a" : "b"}
?
是的,语法中双引号字符串文字之外的空格将被忽略.具体地说,JSON语法RFC 4627中的ws
个结果显示:
Insignificant whitespace is allowed before or after any of the six structural characters. ws = *( %x20 / ; Space %x09 / ; Horizontal tab %x0A / ; Line feed or New line %x0D ; Carriage return )