java拼接JSON串_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > java拼接JSON串

java拼接JSON串

 2019/10/23 12:36:29  anlinko  程序员俱乐部  我要评论(0)
  • 摘要://java拼接JSON串Stringstr="{\"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\"
  • 标签:Java JSON JS
class="java">
//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();
}


发表评论
用户名: 匿名