Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Remove(const StartIndex: Integer): Substring; overload; | |
| 2 | function Remove(const StartIndex, Count: Integer): Substring; overload; | This string without Count characters at StartIndex, or without everything from StartIndex; this string is unchanged. |
Overload 1: function Remove(const StartIndex: Integer): Substring; overload;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | StartIndex | Integer |
Returns: Substring
Overload 2: function Remove(const StartIndex, Count: Integer): Substring; overload;
This string without Count characters at StartIndex, or without everything from StartIndex; this string is unchanged.
| # | Name | Description |
|---|---|---|
| 1 | StartIndex | 0-based; the range removed must lie inside the text, else ESubstringRangeError is raised. |
Returns: Substring - At either end the part that remains, as Mid returns it; in the middle a new value.
Examples
Removing from the middle and from a position on.
uses Substr;
procedure Example;
begin
Assert(Substring('abcdef').Remove(1, 2) = 'adef');
Assert(Substring('abcdef').Remove(3) = 'abc');
end;