Overload List
| # | Signature | Description |
|---|---|---|
| 1 | class function Create(const C: Char; const Count: Integer): Substr.Substring; overload; static; | A new value: Count times C, the characters of Value, or Length characters of Value from StartIndex. |
| 2 | class function Create(const Value: array of Char): Substr.Substring; overload; static; | |
| 3 | class function Create(const Value: array of Char; const StartIndex, Length: Integer): Substr.Substring; overload; static; |
Overload 1: class function Create(const C: Char; const Count: Integer): Substr.Substring; overload; static;
A new value: Count times C, the characters of Value, or Length characters of Value from StartIndex.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | C | Char | |
| 2 | Count | Integer |
Returns: Substring - The new value, inline when it fits.
Remarks:
A negative Count, or a range outside Value, raises ESubstringRangeError.
Examples
Repeated and copied characters.
uses Substr;
procedure Example;
begin
Assert(Substring.Create('-', 3) = '---');
Assert(Substring.Create(['a', 'b']) = 'ab');
Assert(Substring.Create(['a', 'b', 'c'], 1, 2) = 'bc');
end;
See Also: Substr.StringOfChar
Overload 2: class function Create(const Value: array of Char): Substr.Substring; overload; static;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | array of Char |
Returns: Substring
Overload 3: class function Create(const Value: array of Char; const StartIndex, Length: Integer): Substr.Substring; overload; static;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | array of Char | |
| 2 | StartIndex | Integer | |
| 3 | Length | Integer |
Returns: Substring