How to convert a String to JsonObject using gson library

后端 未结 9 1314
既然无缘
既然无缘 2020-11-30 23:45

Please advice how to convert a String to JsonObject using gson library.

What I unsuccesfully do:

String stri         


        
9条回答
  •  执念已碎
    2020-12-01 00:20

    String string = "abcde"; // The String which Need To Be Converted
    JsonObject convertedObject = new Gson().fromJson(string, JsonObject.class);
    

    I do this, and it worked.

提交回复
热议问题