<PackageReference Include="System.Memory" Version="4.6.3" />

StandardFormat

Represents a standard formatting string without using an actual String. A StandardFormat consists of a character (such as 'G', 'D' or 'X') and an optional precision ranging from 0..99, or the special value NoPrecision.
public const byte MaxPrecision = 99

The maximum valid precision value.

public const byte NoPrecision = 255

Precision values for format that don't use a precision, or for when the precision is to be unspecified.

public bool HasPrecision { get; }

true if Precision is a value other than NoPrecision

public bool IsDefault { get; }

true if the StandardFormat == default(StandardFormat)

public byte Precision { get; }

The precision component of the format. Ranges from 0..9 or the special value NoPrecision.

public char Symbol { get; }

The character component of the format.

public StandardFormat(char symbol, byte precision = 255)

Create a StandardFormat.

public static bool op_Equality(StandardFormat left, StandardFormat right)

Returns true if both the Symbol and Precision are equal.

public static StandardFormat op_Implicit(char symbol)

Converts a character to a StandardFormat using the NoPrecision precision.

public static bool op_Inequality(StandardFormat left, StandardFormat right)

Returns false if both the Symbol and Precision are equal.

public static StandardFormat Parse(ReadOnlySpan<char> format)

Converts a classic .NET format string into a StandardFormat

public static StandardFormat Parse(string format)

Converts a classic .NET format string into a StandardFormat

public bool Equals(StandardFormat other)

Returns true if both the Symbol and Precision are equal.