This topic describes the syntax, features, parameters, and return values of array functions. This topic also provides examples of these functions.
arr_concat | arr_insert | arr_remove | arr_sort | arr_len
arr_concat
Item | Description |
---|---|
Syntax | arr_concat(tbl, sep) |
Feature | Concatenates strings in a specified table by using a specified character. |
Parameters |
|
Example |
|
Return values | A string that is concatenated by using the specified character. In this example, t1&t2&t3 is returned.
|
arr_insert
Item | Description |
---|---|
Syntax | arr_insert(list, value, [pos]) |
Feature | Inserts elements into an array. |
Parameters |
|
Example |
|
Return values | A value of true . In this example, arr_insert:61352 is returned.
|
arr_remove
Item | Description |
---|---|
Syntax | arr_remove(list, [pos]) |
Feature | Removes elements at the specified position from an array and returns the removed elements. If you do not set the pos parameter, the element that is at the end of the array is removed. |
Parameters |
|
Example |
|
Return values | The element that is removed from the specified array. In this example, arr_remove:3 is returned.
|
arr_sort
Item | Description |
---|---|
Syntax | arr_sort(list, [comp]) |
Feature | Sorts elements from the beginning to the end of the index in an array in a specified
order.
|
Parameters |
|
Example |
|
Return values | A value of true . In this example, the following values are returned:
|
arr_len
Item | Description |
---|---|
Syntax | arr_len(arr) |
Feature | Counts the number of elements in an array. |
Parameters | arr: the array. |
Example |
|
Return values | The number of elements in the specified array. Data type: numeric. In this example,
1 is returned.
|