IStringList.GetRange

Syntax

GetRange(Index: Integer; Count: Integer): IStringList;

Parameters

Index. Element index, starting from which the range should be obtained.

Count. The number of array elements in the range that should be obtained.

Description

The GetRange method returns the array range according to the specified parameters.

Example

Sub UserProc;
Var
    StrL, StrL1: IStringList;
    i: Integer;
Begin
    StrL := New StringList.Create;
    StrL1 := New StringList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrL.Add("Number " + Math.RandBetweenI(0100).ToString);
    End For;
    StrL1 := StrL.GetRange(10, StrL.Count - 20)
End Sub UserProc;

After executing the example the StrL dynamic array is generated. The StrL1 array contains a copy of the StrL array except for the first and last 10 elements.

See also:

IStringList