JSONObject j = unlockJson.getJSONArray("records").getJSONObject(0);
System.out.println(j.toJSONString());
// 去掉value为空的键值对
Iterator<Map.Entry<String, Object>> it = j.entrySet().iterator();
while (it.hasNext()){
Map.Entry<String, Object> temp = it.next();
if (temp.getValue().toString().length()<1){
it.remove();
}
}
System.out.println(j.toJSONString());
去掉value为空的键值对
最新推荐文章于 2022-08-17 11:14:31 发布