导入包:json-smart-1.2.jar
1,将json格式的String转化为JsonObject
String str = "{\"name\":\"小王\",\"age\":18}";
JSONObject jsonobject = JSONObject.fromObject(str);
String name = (String) jsonobject.get("name");
导入包:json-smart-1.2.jar
1,将json格式的String转化为JsonObject
String str = "{\"name\":\"小王\",\"age\":18}";
JSONObject jsonobject = JSONObject.fromObject(str);
String name = (String) jsonobject.get("name");