Replace whitespace in JSON keys

后端 未结 6 1209
暗喜
暗喜 2020-12-20 02:16

I am thinking of a best solution to replace all the whitespaces in JSON keys with underscore.

{ 
  \"Format\": \"JSON\", 
  \"TestData\": { 
    \"Key with          


        
6条回答
  •  天涯浪人
    2020-12-20 02:48

    Remove only the white space on the strings in jason code not all white space on jason code

    public String removeWhiwspaceInJasonString(String jsonStr) {
        boolean changeActive = false;
        String output = '';
        for(int i=0; i

提交回复
热议问题