IStringList.ReverseRange

Syntax

ReverseRange(Index: Integer; Count: Integer);

Parameters

Index. Index of the element, from which the range starts.

Count. Number of range elements.

Description

The ReverseRange method inverts the array range.

Example

Sub Main;

Var

StrL: IStringList;

i: Integer;

Begin

StrL:=New StringList.Create;

For i:=0 To Math.RandBetweenI(50,100) Do

StrL.Add("Number "+Math.RandBetweenI(0,100).ToString);

End For;

StrL.ReverseRange(Double.FloorInt(StrL.Count/2),Double.FloorInt(StrL.Count/2)+1);

End Sub Main;

After executing the example a dynamic array of strings is generated, the second part of the array is inverted.

See also:

IStringList