嗨,我已经从 PHP 编码了 JSON,结果如下:
{"ticket":[
{"ticket":[{"a":"10.00","b":"1.00","c":"1.00","d":"abcde","f":"7"},
{"ticket":[{"a":"10.00","b":"1.00","c":"1.00","d":"abcde","f":"7"}
]}
object {1}
ticket [2]
0 {6}
a : 10.00
b : 1.00
c : 1.00
d : abcde
e : 7
1 {6}
a : 10.00
b : 1.00
c : 1.00
d : abcde
e : 7
当我在 java 中打开它时,整个事情都会变成一个JSONObject
,我分成两个JSONArray
,第一个包含工作ticket
,然后第二个包含
{"ticket":[{"a":"10.00","b":"1.00","c":"1.00","d":"abcde","f":"7"},
{"ticket":[{"a":"10.00","b":"1.00","c":"1.00","d":"abcde","f":"7"}
如您所料,第二个JSONArray
的长度为2,可以分解为上面的两行(每行作为一个字符串),但是有没有一种方法可以让我从字符串中取出数据,而无需对其进行任何操作/对其进行标记寻找a
, b
, c
...等的值?