Substring.Parse Method

Overload List

#SignatureDescription
1class function Parse(const Value: Boolean): Substr.Substring; overload; static;
2class function Parse(const Value: Double): Substr.Substring; overload; static;The text of a Double as FloatToStr writes it, its 15 significant digits correctly rounded, held inline.
3class function Parse(const Value: Double; const Format: TFloatFormat; const Precision, Digits: Integer): Substr.Substring; overload; static;
4class function Parse(const Value: Double; const Format: TFloatFormat; const Precision, Digits: Integer; const AFormatSettings: TFormatSettings): Substr.Substring; overload; static;
5class function Parse(const Value: Int64): Substr.Substring; overload; static;
6class function Parse(const Value: Integer): Substr.Substring; overload; static;The text of a number or a Boolean, as IntToStr and BoolToStr write it, held inline.
7class function Parse(const Value: Single; const Format: TFloatFormat; const Precision, Digits: Integer): Substr.Substring; overload; static;
8class function Parse(const Value: Single; const Format: TFloatFormat; const Precision, Digits: Integer; const AFormatSettings: TFormatSettings): Substr.Substring; overload; static;

Overload 1: class function Parse(const Value: Boolean): Substr.Substring; overload; static;

#NameTypeDescription
1ValueBoolean

Returns: Substring

Overload 2: class function Parse(const Value: Double): Substr.Substring; overload; static;

The text of a Double as FloatToStr writes it, its 15 significant digits correctly rounded, held inline.

#NameTypeDescription
1ValueDoublescalar

Returns: Substring - FloatToStr's text: digits, the decimal separator of FormatSettings, an exponent where FloatToStr writes one; NAN, INF or -INF.

Examples

Texts without a decimal separator.

uses Substr;

procedure Example;
begin
    Assert(Substring.Parse(2.0) = '2');
    Assert(Substring.Parse(1e20) = '1E20');
end;
See Also: Substr.FloatToStr

Overload 3: class function Parse(const Value: Double; const Format: TFloatFormat; const Precision, Digits: Integer): Substr.Substring; overload; static;

#NameTypeDescription
1ValueDoublescalar
2FormatTFloatFormat
3PrecisionInteger
4DigitsInteger

Returns: Substring

Overload 4: class function Parse(const Value: Double; const Format: TFloatFormat; const Precision, Digits: Integer; const AFormatSettings: TFormatSettings): Substr.Substring; overload; static;

#NameTypeDescription
1ValueDoublescalar
2FormatTFloatFormat
3PrecisionInteger
4DigitsInteger
5AFormatSettingsTFormatSettings

Returns: Substring

Overload 5: class function Parse(const Value: Int64): Substr.Substring; overload; static;

#NameTypeDescription
1ValueInt64

Returns: Substring

Overload 6: class function Parse(const Value: Integer): Substr.Substring; overload; static;

The text of a number or a Boolean, as IntToStr and BoolToStr write it, held inline.

#NameTypeDescription
1ValueInteger

Returns: Substring - IntToStr's digits; for a Boolean, '-1' for True and '0' for False.

Examples

Numbers and Booleans.

uses Substr;

procedure Example;
begin
    Assert(Substring.Parse(-17) = '-17');
    Assert(Substring.Parse(Int64(9000000000)) = '9000000000');
    Assert(Substring.Parse(True) = '-1');
end;
See Also: Substr.IntToStr, Substr.IntToStr

Overload 7: class function Parse(const Value: Single; const Format: TFloatFormat; const Precision, Digits: Integer): Substr.Substring; overload; static;

#NameTypeDescription
1ValueSinglescalar
2FormatTFloatFormat
3PrecisionInteger
4DigitsInteger

Returns: Substring

Overload 8: class function Parse(const Value: Single; const Format: TFloatFormat; const Precision, Digits: Integer; const AFormatSettings: TFormatSettings): Substr.Substring; overload; static;

#NameTypeDescription
1ValueSinglescalar
2FormatTFloatFormat
3PrecisionInteger
4DigitsInteger
5AFormatSettingsTFormatSettings

Returns: Substring