TSubstringList.Items Property

property Items[const Index: Integer]: PSubstring read GetItemPtr;

Item Index (0..Count - 1) itself: every Substring member works on it in place.

#NameDescription
1Index

The item's index, 0..Count - 1.

Returns: PSubstring

Remarks:

The pointer is valid until the item is deleted, Capacity is set or the list shrunk; growing moves no item. An Index outside the list raises EStringListError.

Examples

An item grown in place.

uses Substr;

procedure Example;
var List: TSubstringList;
begin
    List := TSubstringList.Create(4);
    try
        List.Add('ab');
        List.Items[0].Append('cd');
        Assert(List[0] = 'abcd');
        List.Items[0].Append(Substring.Create('x', 600));
        Assert(List[0].Length = 604);
    finally
        List.Free;
    end;
end;
See Also: TSubstringList.Strings