TSubstringList.Expand Method

function Expand: TSubstringList;

Grows the list when every row is in use, keeping every item as Resize does, by half its capacity rounded up to a multiple of 128.

Returns: TSubstringList - The list.

Examples

Room for one more, every item kept.

uses Substr;

procedure Example;
var List: TSubstringList;
begin
    List := TSubstringList.Create(2);
    try
        List.Add('a');
        List.Add('b');
        List.Expand.Add('c');
        Assert((List.Count = 3) and (List[0] = 'a') and (List.Capacity >= 3));
    finally
        List.Free;
    end;
end;
See Also: TSubstringList.Resize, TSubstringList.Capacity