delete value from json array with index

Solutions on MaxInterview for delete value from json array with index by the best coders in the world

showing results for - "delete value from json array with index"
Isabelle
18 Jul 2016
1ArrayList<String> list = new ArrayList<String>();     
2JSONArray jsonArray = (JSONArray)jsonObject; 
3int len = jsonArray.length();
4if (jsonArray != null) { 
5   for (int i=0;i<len;i++){ 
6    list.add(jsonArray.get(i).toString());
7   } 
8}
9//Remove the element from arraylist
10list.remove(position);
11//Recreate JSON Array
12JSONArray jsArray = new JSONArray(list);