Scalar FunctionsDynamic / JSON Functions
array_split
Split a dynamic array at one or more indices.
A scalar integer index
yields [items[..i], items[i..]]; a dynamic array of integer indices
yields n+1 subarrays. Negative indices count from the end; indices
beyond the array length produce empty trailing subarrays.
Syntax
array_split(array, indices)Parameters
Prop
Type
Returns: dynamic
Examples
Example 1
print array_split(dynamic([1, 2, 3, 4, 5, 6]), dynamic([2, 4]))| print_0 (dynamic) |
|---|
| [[1,2],[3,4],[5,6]] |