util.JSONArray.remove()

 

util.JSONArray.remove() removes the specified member from the JSON array.

 

Syntax:

 

util.JSONObject.remove(index)

 

Parameters:

 

index

an index of the member to be removed

 

Usage and examples:

 

util.JSONArray.remove() takes the index of the array member as the parameter and deletes this member.

 

The index of the first array member is 1.

 

example code

MAIN

  DEFINE json_arr util.JSONArray

    LET json_arr = util.JSONArray.create()

    CALL json_arr.put(1, 123)

    CALL json_arr.put(2, "abc")

    DISPLAY json_arr.toString()

    CALL json_arr.remove(1)

    DISPLAY json_arr.toString()

  CALL fgl_getkey()

END MAIN

 

obtained results

 

 

 

Example programs:

CVS server: client.querix.com

CVS repository: /lycia_doc_examples

User: client

Project: auxiliary_features/json

Program: util_JSONArray_remove

 

Related articles:

util.JSONArray.put()

util.JSONArray.get()