IStringList.AddRange

Syntax

AddRange(Collection: ICollection);

Parameters

Collection. Collection of elements that should be added to the array.

Description

The AddRange method adds the specified collection of element to the end of array.

Example

Sub UserProc;
Var
    StrL1, StrL2: IStringList;
    i: Integer;
Begin
    StrL1 := New StringList.Create;
    StrL2 := New StringList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrL1.Add("Value " + Math.RandBetweenI(0100).ToString);
    End For;
    For i := 0 To Math.RandBetweenI(50100Do
        StrL2.Add("Value " + Math.RandBetweenI(100200).ToString);
    End For;
    StrL1.AddRange(StrL2);
End Sub UserProc;

On executing the example two dynamic arrays of strings are generated. Values of the second array will be added to the end of the first one.

See also:

IStringList