import org.apache.commons.lang.StringEscapeUtils;
public class RemoveTest {
public static void main(String[] args) {
String str = "{\\\"name\\\": \\\"tom\\\", \\\"age\\\": 18}";
// {\"name\": \"tom\", \"age\": 18}
System.out.println(str);
String escapeStr = StringEscapeUtils.unescapeJava(str);
// {"name": "tom", "age": 18}
System.out.println(escapeStr);
}
}
去掉JSON字符串中的转义字符
最新推荐文章于 2023-12-19 15:11:17 发布