ITeye博客

java拼接JSON串

anlinko · 2019-10-23 09:53 · json拼接 · 编程语言 · Java · Markdown


//java拼接JSON串
String str = "{\"route\":\"onGift\",\"time\":\"\",\"userId\":\"\",\"userName\":\"\",\"level\":\"1_2_2_2_0\",\"adminType\":0,\"tuserId\":\"\"," +
        "\"tuserName\":\"\",\"tlevel\":\"10_2_2_2_0\",\"roomId\":\"\",\"giftId\":\"001\",\"fcId\":\"0\",\"amount\":\"1\",\"price\":\"0\",\"bean\":\"6546316\"}";

JSONObject json = null;

try {
    json = new JSONObject(str);
} catch (JSONException e) {
    e.printStackTrace();
}



评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。