小编gna*_*rus的帖子

替换JSON密钥中的空格

我正在考虑用下划线替换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库具有任何预定义的功能来执行此操作?

java parsing json

2
推荐指数
1
解决办法
8558
查看次数

标签 统计

java ×1

json ×1

parsing ×1