function LeftStr(const AText: Substring; const ACount: Integer): Substring; overload; inline;
The first ACount characters of AText.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | AText | Substring | |
| 2 | ACount | Integer |
Returns: Substring - The part, as Mid returns it.
Remarks:
An ACount outside 0 .. Length raises ESubstringRangeError.
Examples
The first characters.
uses Substr;
procedure Example;
begin
Assert(LeftStr(Substring('abcdef'), 2) = 'ab');
end;