ArraySlice
Extracts a sub array from an existing array.
Method Signature
ArraySlice(array=[array], start=[integer], length=[integer])Arguments
Argument
Type
Required
Description
Default
array
array
true
start
integer
true
1
length
integer
false
0
Examples
Simple arraySlice Example
array = [
1,
2,
3,
4,
5,
6,
7,
8
];
newArray = arraySlice( array, 2, 3 );
writedump( newArray );
Result: [2,3,4]
arraySlice with no length specified
Result: [4,5,6,7,8]
arraySlice using a negative offset
Result: [4,5,6]
Slice an array using member function
CF11+ calling the slice member function on an array.
Result: [2,3,4]
Additional Examples
Related
Last updated
Was this helpful?
