Answers for "delete value from json array with index"

0

delete value from json array with index

ArrayList<String> list = new ArrayList<String>();     
JSONArray jsonArray = (JSONArray)jsonObject; 
int len = jsonArray.length();
if (jsonArray != null) { 
   for (int i=0;i<len;i++){ 
    list.add(jsonArray.get(i).toString());
   } 
}
//Remove the element from arraylist
list.remove(position);
//Recreate JSON Array
JSONArray jsArray = new JSONArray(list);
Posted by: Guest on July-20-2020

Code answers related to "delete value from json array with index"

Code answers related to "Javascript"

Browse Popular Code Answers by Language