正则表达式:删除 JSON 中十进制数字的引号

问题描述 投票:0回答:0

我正在寻找 Java 中的

replaceAll()
正则表达式选项以删除
"20.45"
周围的引号(带两位小数的数字)。字符串转换为 JSON。

输入:

String before = "{\"Claim\":\"111111\",\"Res\":\"word\",\"Resolution\":\"word\",\"Amount\":\"20.45\"}"

输出:

String afterReplaceAll = "\"Claim\":\"111111\",\"Res\":\"word\",\"Resolution\":\"word\",\"Amount\":20.45}"
java json decimal quotes
© www.soinside.com 2019 - 2024. All rights reserved.