Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Trim: Substring; overload; | The text without the characters <= ' ' at both ends. |
| 2 | function Trim(const TrimChars: array of Char): Substr.Substring; overload; | The text without the characters of TrimChars at both ends. |
Overload 1: function Trim: Substring; overload;
The text without the characters <= ' ' at both ends.
Returns: Substring - The part, as Mid returns it.
Examples
Spaces and a tab removed.
uses Substr;
procedure Example;
begin
Assert(Substring(' a b '#9).Trim = 'a b');
end;
See Also: Substring.Trim, Substring.Trim
Overload 2: function Trim(const TrimChars: array of Char): Substr.Substring; overload;
The text without the characters of TrimChars at both ends.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | TrimChars | array of Char |
Returns: Substring - The part, as Mid returns it.
Examples
Dashes removed at both ends.
uses Substr;
procedure Example;
begin
Assert(Substring('--a-b--').Trim(['-']) = 'a-b');
end;