Exchanges the two elements within the array.
Note: This method will fail if one of the parameters is larger or smaller than the number of elements in the array.
array->exchange(first_position, second_position)
This example exchanges the 2nd and 5th elements of an array.
Code
var( myArray = array('one', 'two', 'three', 'four', 'five', 'six', 'seven') )
//output original array
$myArray
'\n'
$myArray->exchange(2,5)
//output modified array
$myArray
Result
array(one, two, three, four, five, six, seven) array(one, five, three, four, two, six, seven)
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments