Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • can we get how many objects in json string Commented Nov 11, 2011 at 8:11
  • 2
    Yes you can simply use "mainObject.length();" Commented Nov 11, 2011 at 8:12
  • 2
    Edited to use getString() instead of getJSONObject() when getting String values. Using getJSONObject() caused a JSONException when I ran similar code that was fixed by using getString(). Commented Nov 1, 2015 at 23:40
  • 4
    getString(), not getJsonString() as is written in the example, right? Commented Dec 11, 2016 at 23:21
  • Right @de. It should getString(), not getJsonString() Commented Nov 12, 2019 at 11:02