array.mid()

Extracts a sub array from an array.

array.mid( start=number, count=number )

Returns: Array

Argument Description
start
number, required

The position of the first element to retrieve.

count
number, optional

The number of elements to retrieve. If not set, all elements until the end of the array will be returned.

Examples

fruits = ["apple","orange","banana","orange","orange"];
writeDump(fruits.mid(2,3));
writeDump(fruits.mid(1,3));
writeDump(fruits.mid(3,8));

See also