【Redis】JAVA 从Redis中取出Json字符串 带斜杠的问题解决方案

解决方案:

//去除前后的引号 "
userJsonStr = userJsonStr.substring(1, userJsonStr.length() - 1);
//去除转义符
userJsonStr = userJsonStr.replaceAll("\\\\", "");
JSONObject jsonObject = JSONUtil.parseObj(userJsonStr);

本文转载:https://blog.csdn.net/G971005287W/article/details/106136531

posted @ 2021-12-13 23:00  rongbu2  阅读(822)  评论(0)    收藏  举报