will RT, have this kind of json?
will RT, have this kind of json?
No, first of all, we need to understand the data structure of java language, and secondly, we need to understand the data format of json.
you can take a look at the json data format: http://www.jb51.net/article/1.
such a structure without square brackets is not legal JSON
. If you are sure that adding square brackets is legal, you can add square brackets before and after.
String invalid = "{\"1\":\"1\"},{\"2\":\"2\"}";
String valid = "[" + invalid + "]"
String valid2 = new StringBuilder("[").append(invalid).append("]").toString();