• #42896

    How to delete an index from JSON Obj?

    How to delete an index from JSON Obj?


    Hi Chanchal,

    You can remove an element from the JSONArray object using the remove() method. This method accepts an integer and removes the element in that particular index.

    import org.json.JSONArray;

    public class RemoveFromJsonArray {
       public static void main(String args[]) throws Exception {
          String [] myArray = {“JavaFX”, “HBase”, “JOGL”, “WebGL”};
          JSONArray jsArray = new JSONArray();
          for (int i=0; i < myArray.length; i++) {
         System.out.println(“After deleting ::”+jsArray);

Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?