ReverseRange(Index: Integer; Count: Integer);
Index. Index of the element, from which a range starts.
Count. Number of range elements.
The ReverseRange method sets reverse order of array element range.
Sub Main;
Var
ArrayL: IArrayList;
i: Integer;
Begin
ArrayL:=New ArrayList.Create;
For i:=0 To Math.RandBetweenI(50,100) Do
ArrayL.Add(Math.RandBetweenI(0,100));
End For;
ArrayL.ReverseRange(Double.FloorInt(ArrayL.Count/2),Double.FloorInt(ArrayL.Count/2)+1);
End Sub Main;
After executing the example a dynamic array of strings is generated, the second part of the array is reversed.
See also: