TSubstringList.Text Property

property Text: Substring read GetTextStr write SetText;

The items as lines: each followed by LineBreak, the last one too while TrailingLineBreak is True.

Returns: Substring

Remarks:

Returns items separated by line breaks. Writing it replaces the items split on line breaks.

Examples

Lines in, text out.

uses Substr;

procedure Example;
var List: TSubstringList;
begin
    List := TSubstringList.Create(2);
    try
        List.Text := Substring('x' + sLineBreak + 'y');
        Assert((List.Count = 2) and (List[1] = 'y'));
        List.TrailingLineBreak := False;
        Assert(List.Text = 'x' + sLineBreak + 'y');
    finally
        List.Free;
    end;
end;
See Also: TSubstringList.SetText, TSubstringList.LineBreak, TSubstringList.TrailingLineBreak, TSubstringList.ToString