Item(Index: Integer): String;
Index. Element index.
The Item property returns value of string array element, which index is passed by the Index parameter.
Sub Main;
Var
StrL: IStringList;
i: Integer;
s: String;
Begin
StrL:=New StringList.Create;
For i:=0 To Math.RandBetweenI(50,100) Do
StrL.Add("Number "+Math.RandBetweenI(0,100).ToString);
End For;
s:=StrL.Item(Math.RandBetweenI(0,StrL.Count));
End Sub Main;
After executing the example a dynamic array of strings is generated, and the "s" variable contains random array element.
See also: