Functions Index :: A :: ArrayGetRange

[<< up one level]

Module:

array :: slices

Definition:

ArrayGetRange(string array, int "start_index", int "end_index")

Description:

Retrieves a range of elements (a subarray) from array and returns it as a new array. The function returns all elements contained in [start_index..end_index) ie the element array[end_index] is not returned.

Arguments:

array: The array to retrieve the element range (subarray) from.

"start_index" (Optional, defaults to 0): The starting index of the element range that will be retrieved.

"end_index" (Optional, defaults to array.ArrayLen()): The ending index of the element range that will be retrieved.

Examples:

a1 = "0.5, 1.0, 1.5, 2.0, 2.5"

a2 = a1.ArrayGetRange() # a2 == a1

a3 = a1.ArrayGetRange(0, 2) # a3 == "0.5,1"

a4 = a1.ArrayGetRange(3) # a4 == "2,2.5"

a5 = a1.ArrayGetRange(end_index=3) # a5 == "0.5,1,1.5"

 

[<< top]