slice
To extract a subrange from a string or array
This function helps you to extract a partial range of an array and transfer it to a new array. You define the part you want to extract by a start and an end position. Start and end position start with 0.
The start is inclusive, the end is exclusive. If the end value is larger than the total number of array elements, the array will be extracted from a given start until the end of the array.
Use this function also to get an extract out of a text. In this case, each character of the text corresponds to an array element.
slice([any], number, number)
slice(string, number, number)
[any]
string
slice(array, start, end)
To extract a sub-array. Start and end are zero-based.1
slice(["Apple","Bagel","Cake","Donut"], 1, 3)
Result: Bagel,Cake
slice(text, start, end)
To extract a text piece. Start and end are zero-based.1
slice("Mermaid", 3, 7)
Result: maid
Last modified 1yr ago