util.JSONArray.delete()

util.JSONArray.delete() deletes the specified member(s) from the JSON array.

Syntax

CALL util.JSONArray.delete(<index>)

or

CALL util.JSONArray.delete(<startIndex>,<endIndex>)

Parameters

index

an index of the array member to be deleted

startIndex the first element in the range of items that need to be deleted
endIndex the last element in the range of items that need to be deleted

Usage and examples

util.JSONArray.delete() takes an index of the array member as the parameter and deletes this member. If used with two indexes as parameters, divided with comma, deletes the range of array members.

The index of the first array member is 1.

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.delete(1)
DISPLAY json_arr.toString()
CALL fgl_getkey()
END MAIN

 

 

Contact Us

Privacy Policy

Copyright © 2025 Querix, (UK) Ltd.