Swapping two variables

Swap(
     var:value1,
     var:value2
)
none

Arguments

value1

First variable.

value2

Second variable.

Description

Swaps the values of the two variables.

Example:

i = "World";
j = "Hello";
Swap(i, j);
Output( i + " " + j );
--> Hello World
Swapping two array elements

Swap(
     arr:array,
     int:index1,
     int:index2
)
none

Arguments

array

Array

index1

First index.

index2

Second index.

Description

Swaps the values of two array elements.