zoukankan      html  css  js  c++  java
  • java 处理json格式数据中的转义斜杠

    1、{"Count":"3","ErrorString":"","Success":true,"URL":"http:\/\/172.16.80.65:8080\/LoginSSO.aspx?UserCode=wubg&Type=WorkItem","UserId":"1226","biztype":"19110","Results":[{"ActivityId":"6d216e2b-25dc-4978-88a8-2fb5bfbd690c","ActivityName":"部门负责人","Money":"","ParticipantId":"1226","ParticipantName":"乌宝贵","PreActivityName":"","StartTime":"2017\/6\/21 20:55:59","State":"0","Type":"资产处置","WorkId":"46789861-4dc5-4dd9-87e0-5cb4df8bf3ff","WorkItemURL":"SBmanager\/Equipment_AssetDispose_New.aspx?sitemap='所在位置: 生命周期管理 > 资产处置> 部门负责人'"},{"ActivityId":"05ec02e4-6e11-4791-b2ed-9debf6fef516","ActivityName":"部门领导意见","Money":"","ParticipantId":"1226","ParticipantName":"乌宝贵","PreActivityName":"","StartTime":"2017\/6\/21 20:41:57","State":"0","Type":"资产出库","WorkId":"56ae6661-4379-4b25-b231-2586609d0e11","WorkItemURL":"DataBaseBef\/Equipment_YANSHOU_CK_NEW.aspx?sitemap='所在位置:生命周期管理 > 验收出库 > 部门领导意见'"},{"ActivityId":"9f0cc043-6bea-446c-90ac-1b228450ebd0","ActivityName":"使用部门负责人意见","Money":"","ParticipantId":"1226","ParticipantName":"乌宝贵","PreActivityName":"","StartTime":"2017\/6\/21 21:25:56","State":"0","Type":"领用出库单","WorkId":"980ee135-2587-4469-9b5a-8929afcfc728","WorkItemURL":"SBmanager\/Equipment_QL.aspx?sitemap='所在位置: 生命周期管理 >  资产领用 > 使用部门负责人意见'"}]}

    2、将1中的json格式字符串处理为json对象,需要先去掉转义""
      
     result = StringEscapeUtils.unescapeJava(result);
                    
     JSONObject jsonObject = new JSONObject(result); 
     jsonObject.get("Count");

      




  • 相关阅读:
    linux
    查看字符的编码数字
    各种语系的unicode对应以及local编码方式
    Unicode字符集,各个语言的区间
    深入理解Python的字符编码
    php 快排
    归并排序
    检测到在集成的托管管道模式下不适用的 ASP.NET 设置的解决方法
    分布式缓存MemcacheHelper
    单例模式
  • 原文地址:https://www.cnblogs.com/Garnett-Boy/p/7091046.html
Copyright © 2011-2022 走看看