private static String jsonString(String s) {
char[] temp = s.toCharArray();
int n = temp.length;
for (int i = 0; i < n; i++) {
if (temp[i] == ':') {
int quentIndex = i + 1;
while (StringUtils.isBlank(String.valueOf(temp[quentIndex]))) {
quentIndex++;
}
if (temp[quentIndex] == '"') {
for (int j = quentIndex + 1; j < n; j++) {
if (temp[j] == '"') {
if (temp[j + 1] != ',' && temp[j + 1] != '}') {
temp[j] = '”';
} else if (temp[j + 1] == ',' || temp[j + 1] == '}') {
break;
}
}
}
}
}
}
return new String(temp);
}

  

private static String jsonString(String s) {    char[] temp = s.toCharArray();    int n = temp.length;    for (int i = 0; i < n; i++) {        if (temp[i] == ':') {            int quentIndex = i + 1;            while (StringUtils.isBlank(String.valueOf(temp[quentIndex]))) {                quentIndex++;            }            if (temp[quentIndex] == '"') {                for (int j = quentIndex + 1; j < n; j++) {                    if (temp[j] == '"') {                        if (temp[j + 1] != ',' && temp[j + 1] != '}') {                            temp[j] = '”';                        } else if (temp[j + 1] == ',' || temp[j + 1] == '}') {                            break;                        }                    }                }            }        }    }    return new String(temp);————————————————版权声明:本文为CSDN博主「JensonXIE」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.csdn.net/yefeng0810/article/details/98203137

最新文章

  1. Notes:SVG(1)
  2. 提高Baidu Map聚合的效率
  3. javascript冒泡排序一些新实现
  4. NIO概述
  5. A VNC server is already running as :1
  6. ubuntu安装bower失败的解决方法
  7. android activity空指针异常解决问题解决
  8. C#画图
  9. 在Apache中开启虚拟主机
  10. Google code: Why ‘Everything up-to-date’ when pushing (git)
  11. FreeMarker中if标签内的判断条件
  12. HAOI 硬币购物
  13. Gmail 一些需注意的事
  14. IOS优秀博客
  15. 从硬件竞争到软实力PK——电视媒体竞争观察
  16. 微信小游戏开发之四:使用three.js引擎
  17. @Autowired和@Resource注解的一个意外重要区别
  18. XP下ubuntu双系统安装方法
  19. JAVA课堂测试之一位数组可视化
  20. jasperreports实现pdf文档的生成

热门文章

  1. JSP三大指令是什么?
  2. 错误:软件包:php-fpm-5.4.16-42.el7.x86_64 需要:php-common(x86-64)
  3. java并发编程工具类JUC第八篇:ConcurrentHashMap
  4. ConcurrentSkipListMap - 秒懂
  5. MySQL:一条SQL是如何执行的
  6. 分布式事务与Seate框架(3)——Seata的AT模式实现原理
  7. 利用ServletContext,实现Session动态权限变更
  8. Oracle数据泵导出数据库
  9. 详解C++中继承的基本内容
  10. 《手把手教你》系列技巧篇(七)-java+ selenium自动化测试-宏哥带你全方位吊打Chrome启动过程(详细教程)