Functions Index :: A :: ArrayElmSwap

[<< up one level]

Module:

array :: transforms

Definition:

ArrayElmSwap(string array, int index1, int index2)

Description:

Returns a new array with the elements in indices index1, index2 interchanged (ie array[index1] now holds the value of array[index2] at the original array and vice versa).

Examples:

a1 = ArrayCreate(1,2,3,4)

a2 = a1.ArrayElmSwap(0,1) # a2 == "2,1,3,4"

a3 = a2.ArrayElmSwap(2,3) # a3 == "2,1,4,3"

a4 = a3.ArrayElmSwap(0,3) # a4 == "4,1,3,2"

 

[<< top]