Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Substring(const StartIndex: Integer): Substr.Substring; overload; | The text from StartIndex (0-based) to the end, or Length characters from StartIndex. |
| 2 | function Substring(const StartIndex, Length: Integer): Substr.Substring; overload; |
Overload 1: function Substring(const StartIndex: Integer): Substr.Substring; overload;
The text from StartIndex (0-based) to the end, or Length characters from StartIndex.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | StartIndex | Integer |
Returns: Substring - The part, as Mid returns it.
Remarks:
A range outside the text raises ESubstringRangeError.
Examples
The end of a text, and a part of it.
uses Substr;
procedure Example;
begin
Assert(Substring('abcdef').Substring(4) = 'ef');
Assert(Substring('abcdef').Substring(1, 2) = 'bc');
end;
Overload 2: function Substring(const StartIndex, Length: Integer): Substr.Substring; overload;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | StartIndex | Integer | |
| 2 | Length | Integer |
Returns: Substring