81,094
社区成员
发帖
与我相关
我的任务
分享
String s = "[{\"name\":\"jack\",\"data\":[\"11\",\"22\",\"33\",\"44\"]},{\"name\":\"rose\",\"data\":[\"11\",\"22\",\"33\",\"44\"]}]";
String regex = "\"(\\d+)\"";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(s);
while (matcher.find()) {
String group = matcher.group();
s = s.replace(group, group.substring(1, group.length() - 1));
}
System.out.println(s);