private static final String COMPLEX_JSON_STR =
"{" +
"\"teacherName\":\"crystall\"," +
"\"teacherAge\":27," +
"\"course\":{" +
"\"courseName\":\"english\"," +
"\"code\":1270" +
"}," +
"\"students\":[" +
"{" +
"\"studentName\":\"lily\"," +
"\"studentAge\":12" +
"}," +
"{" +
"\"studentName\":\"lucy\"," +
"\"studentAge\":15" +
"}" +
"]" +
"}";
String tmp = StringEscapeUtils.unescapeJavaScript(str);
JSONObject jsonObject = JSON.parseObject(str, Feature.OrderedField);
// JSONObject jsonObject = new JSONObject(true);
// LinkedHashMap<String, Object> json = JSON.parseObject(str, LinkedHashMap.class, Feature.OrderedField);
// jsonObject.putAll(json);
// jsonObject.remove("crc");//去除crc字段
String resStr = jsonObject.toJSONString();