Convert String to Json

Convert  String to Json

{“a”:1,”b”:2}
Solution 1:
JsonObject =json = new JsonObject(“{“a”:1,”b”:2}”);
Solution 2:
JsonParse parse = new JsonParse();
JsonObject json = parse.parse(String);
Solution 3:

JsonObject json =JsonObject.fromObject(String);
SHARE

Nguyễn Văn Duy

  • Image
  • Image
  • Image
  • Image
  • Image

0 comments:

Post a Comment