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 UserProc;
Var
    StrL: IStringList;
    i: Integer;
Begin
    StrL := New StringList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrL.Add("Number " + Math.RandBetweenI(0100).ToString);
    End For;
    StrL.ReverseRange(Double.FloorInt(StrL.Count / 2), Double.FloorInt(StrL.Count / 2) + 1);
End Sub UserProc;

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

See also:

IStringList