Overload List
| # | Signature | Description |
|---|---|---|
| 1 | class function Format(const Format: string; const Args: array of const): Substr.Substring; overload; static; | The format text with Args written into it. |
| 2 | class function Format(const Format: string; const Args: array of const; const AFormatSettings: TFormatSettings): Substr.Substring; overload; static; |
Overload 1: class function Format(const Format: string; const Args: array of const): Substr.Substring; overload; static;
The format text with Args written into it.
| # | Name | Description |
|---|---|---|
| 1 | Format | The format text, every text kind. |
| 2 | Args | The arguments; the AFormatSettings form takes its separators and currency from the settings given, the other from FormatSettings. |
Returns: Substring - The formatted text, sized once.
Remarks:
Directives: %[index:][-][width][.precision]type; floats are correctly rounded. A directive invalid or incompatible with its argument, a missing argument, or an AnsiString, Variant or object argument raises EConvertError.
Examples
Numbers, texts and a float with explicit settings.
uses Substr, System.SysUtils;
procedure Example;
var fs: TFormatSettings;
begin
Assert(Substring.Format('%d:%s', [7, 'x']) = '7:x');
fs := FormatSettings;
fs.DecimalSeparator := '.';
Assert(Substring.Format('%.1f', [1.26], fs) = '1.3');
end;
See Also: Substring.Format, Substring.Format
Overload 2: class function Format(const Format: string; const Args: array of const; const AFormatSettings: TFormatSettings): Substr.Substring; overload; static;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Format | string | |
| 2 | Args | array of const | |
| 3 | AFormatSettings | TFormatSettings |
Returns: Substring