IStringList.Insert

Syntax

Insert(Index: Integer; Value: String);

Parameters

Index. Index of the position, to which the element should be added.

Value. Value of the element that should be added.

Description

The Insert method inserts the element into the specified position.

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.Insert(StrL.Count, "Last Value");
End Sub UserProc;

After executing the example a dynamic array of strings is generated at the end of the array, and one more element is added.

See also:

IStringList