TSubstringList.Count Property

property Count: Integer read FCount write SetCount;

The number of items. Setting it higher adds empty items, lower deletes the last ones.

Returns: Integer

Examples

Empty items added, the last ones deleted.

uses Substr;

procedure Example;
var List: TSubstringList;
begin
    List := TSubstringList.Create(4);
    try
        List.Add('a');
        List.Count := 3;
        Assert((List.Count = 3) and List[2].IsEmpty);
        List.Count := 1;
        Assert((List.Count = 1) and (List[0] = 'a'));
    finally
        List.Free;
    end;
end;
See Also: TSubstringList.Capacity