# Extract Part of Array | ARRAY_SUB

### Syntax

``ARRAY_SUB( [value], [search] )``

### Parameters

value
The array in which only a part is being returned.

start
The index of where the new sub-array should start. It should be an integer value. If the value is not an integer value, it will be coerced into one using the INTEGER method. If the value is a negative number, it is treated as an index from the end of the array (e.g. -1 is the last item).

end
The index of where the new sub-array should end. Note that the end index is non-inclusive, which means the item at that index will not be included in the result. It should be an integer value. If the value is not an integer value, it will be coerced into one using the INTEGER method. If the value is a negative number, it is treated as an index from the end of the array (e.g. -1 is the last item).

### Return Value

A new ARRAY with the selected entries from the VALUE.

### Description

Create an ARRAY from a section of another ARRAY.

### Examples

``ARRAY_SUB([], 0, 100) # returns []``
``ARRAY_SUB([10, 5, 3, 4, 9], 0, 3) # returns [10, 5, 3]``
``ARRAY_SUB([10, 5, 3, 4, 9], 3, 5) # returns [3, 4, 9]``
``ARRAY_SUB([10, 5, 3, 4, 9], 1, 4) # returns [5, 3, 9]``
``ARRAY_SUB([10, 5, 3, 4, 9], 0, -2) # returns [10, 5, 3]``
``ARRAY_SUB([10, 5, 3, 4, 9], -2, 5) # returns [3, 4, 9]``
``ARRAY_SUB(NULL, 0, 100) # returns []``
``ARRAY_SUB([10, 5, 3, 4, 9], 5, 1) # returns []``