JSON string from Gson: remove double quotes

前端 未结 3 951
悲&欢浪女
悲&欢浪女 2020-12-30 19:28

Here is an example of my Json code:

array(\"id\" => 0, \"navn\" => \"Vind telefon\", \"udgiver\" => \"Telia\", \"beskrivelse\" => utf8_encode(\"V         


        
3条回答
  •  离开以前
    2020-12-30 20:28

    To put object or array properties into your JsonObject and get them back as objects and arrays (not as string), use the approach:

    new JsonObject().add(
      "mySubobject",
      new Gson().toJsonTree(
        new JsonObject()));
    

提交回复
热议问题