0

我将如何遍历 JSONObject 中的这个 JSON 字符串?:

[
   {"Suggestion": "Roosendaal"},
   {"Suggestion": "Rucphen"},
   {"Suggestion": "Rijsbergen"},
   {"Suggestion": "Rijen"},
   {"Suggestion": "Raamsdonksveer"},
   {"Suggestion": "Raamsdonk"},
   {"Suggestion": "Rijswijk NB"}
]
4

1 回答 1

0

我想您正在为此使用 org.json 。

JSONArray array = new JSONArray(s);
int length = array.length();
for (int i = 0; i < length; i++) {
    JSONObject o = array.getJSONObject(i);
    System.out.println(o);
}

sString.

于 2013-09-30T13:57:40.153 回答