Remove an element of a variable of array type.
1 array.remove
<array.remove name='name'>
<row /> ?
</array.remove>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the variable of array type. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Erow | integer | Registry to delete. |
Returns | |
---|---|
Type | Description |
Object | The object which has been removed from the list. |
Example
Remove the element from the second position of the array.
Copy
<xsql-script name='array_remove_test1'> <body> <array name='cities'> <string>Barcelona</string> <string>Paris</string> <string>Rome</string> </array> <array.remove name='cities'> <string>2</string> </array.remove> <println><cities/></println> </body> </xsql-script>
The element whose index is 2, which is 'Rome' is removed from the variable 'cities'.
The result is:
Copy
Barcelona Paris