0

How to parse JSON string like this "[\"login\",{ \"key\":\"value\"}]" to strong typing variable using SimpleJson library?

Programmer
  • 121,791
  • 22
  • 236
  • 328
DeRibura
  • 67
  • 3
  • 7

1 Answers1

0

Try the SimpleJson.TryDeserializeObject method. An instance of an anonymous type is placed in the variable obj, which describes the structure of the JSON object.

SimpleJSON

Community
  • 1
  • 1
Artem Popov
  • 344
  • 2
  • 11
  • How i can access these values? obj[1] doesnt work – DeRibura Feb 03 '18 at 17:48
  • You can cast to a `JsonArray` type or use the generic version (it can throw an exception): `JsonArray array = SimpleJson.DeserializeObject("[\"login\",{ \"key\":\"value\"}]");` – Artem Popov Feb 03 '18 at 18:06