IStringList.RemoveRange

Syntax

RemoveRange(Index: Integer; Count: Integer);

Parameters

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

Count. Number of elements in the range that should be removed.

Description

The RemoveRange method removes element 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.RemoveRange(StrL.Count - 1010);
End Sub UserProc;

After executing the example a dynamic array of strings is generated, and last 10 values are removed from it.

See also:

IStringList