I have the following JSONObject
{"results":2,"object":[{"id":10,"rank":12},{"id":21,"rank":22}.........{"id":n,"rank":n}]}
Now if I have an id: 21, how do I get the position of that object?
Is there any direct way to get the position of that id?
Like 21 is in 2nd position in that array.So the index position is 1. Is there any direct way without looping the JSONArray
to improve the performance?