
java遍历JSONObject的key值及获取key对应的value
json
适用于现代 C++ 的 JSON。
项目地址:https://gitcode.com/gh_mirrors/js/json

·
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
String str = "{FYXID:4C4600835174411190C739805DE593BC,ZFY:0,FYXMC:保安保洁费}";
JSONObject jsonObject = new JSONObject(str);
Iterator it = jsonObject.keys();
while(it.hasNext()){
String key = (String) it.next();// 获得key
String value = jsonObject.getString(key);// 获得value
System.out.println("[key="+key+" val="+value+"]");
}




适用于现代 C++ 的 JSON。
最近提交(Master分支:25 天前 )
7421ac31
Changed the example code in the documentation from copy initialization
to direct initialization for `json::json_pointer`.
This prevents compilation errors caused by the constructor being explicit. 22 小时前
4b17f90f
Added examples and modified the corresponding documents and unit tests.
Signed-off-by: chirsz-ever <chirsz-ever@outlook.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com> 1 天前
更多推荐
所有评论(0)