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, which value is passed by the Value parameter, into the specified position Index.

Example

Sub Main;

Var

StrL: IStringList;

i: Integer;

Begin

StrL:=New StringList.Create;

For i:=0 To Math.RandBetweenI(50,100) Do

StrL.Add("Number "+Math.RandBetweenI(0,100).ToString);

End For;

StrL.Insert(StrL.Count ,"Last Value");

End Sub Main;

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