首页 > 技术文章 > fastjson 移除不要的属性

albert-think 2017-05-05 17:54 原文

public String removeHistoryId(String jsonData) {
        JSONArray arrys = JSON.parseArray(jsonData);
        for (Object o : arrys) {
            JSONObject json = (JSONObject) o;
            json.remove("historyId");
        }
        return arrys.toString();
    }

推荐阅读