我正在考虑用下划线替换JSON密钥中的所有空格的最佳解决方案.
{
"Format": "JSON",
"TestData": {
"Key with Spaces in it": {
"And Again": {
"Child_Key1": "Financial",
"Child_Key2": null
},
.........
.....
Run Code Online (Sandbox Code Playgroud)
我想要将上面的内容转换成如下所示:
{
"Format": "JSON",
"TestData": {
"Key_with_Spaces_in_it": {
"And_Again": {
"Child_Key1": "Financial",
"Child_Key2": null
},
.........
.....
Run Code Online (Sandbox Code Playgroud)
有什么建议 ?
是否有任何Java库具有任何预定义的功能来执行此操作?