How do you represent a JSON array of strings?

后端 未结 4 1151
野趣味
野趣味 2020-12-04 05:12

This is all you need for valid JSON, right?

[\"somestring1\", \"somestring2\"]
4条回答
  •  北海茫月
    2020-12-04 06:10

    String strJson="{\"Employee\":
    [{\"id\":\"101\",\"name\":\"Pushkar\",\"salary\":\"5000\"},
    {\"id\":\"102\",\"name\":\"Rahul\",\"salary\":\"4000\"},
    {\"id\":\"103\",\"name\":\"tanveer\",\"salary\":\"56678\"}]}";
    

    This is an example of a JSON string with Employee as object, then multiple strings and values in an array as a reference to @cregox...

    A bit complicated but can explain a lot in a single JSON string.

提交回复
热议问题