Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Buffers.​StandardFormat

Assembly: System.Memory

Implemented Interfaces

Represents a standard format string without using an actual string.

Fields and Constants

public const byte
MaxPrecision
Defines the maximum valid precision value.
public const byte
NoPrecision
Indicates that a format doesn't use a precision or that the precision is unspecified.

Properties

public bool
HasPrecision
Gets a value that indicates whether a format has a defined precision.
public bool
IsDefault
Gets a value that indicates whether the current instance is a default format.
public byte
Precision
Gets the precision component of the format.
public char
Symbol
Gets the character component of the format.

Methods

public bool
Equals​(StandardFormat other)
Returns a value that indicates whether the specified <see cref="T:System.Buffers.StandardFormat" /> is equal to the current instance.
Returns <see langword="true" /> if the two instances are equal; otherwise, <see langword="false" /> .
other The format to compare to the current instance.
public bool
Equals​(object obj)
Returns a value that indicates whether the specified object is a <see cref="T:System.Buffers.StandardFormat" /> object that is equal to the current instance.
Returns <see langword="true" /> if the two instances are equal; otherwise, <see langword="false" /> .
obj An object to compare to the current instance.
public int
GetHashCode​()
Returns the hash code for this instance.
Returns The hash code for this instance.
public static StandardFormat
Parse​(ReadOnlySpan<​char> format)
Converts a <see langword="ReadOnlySpan&lt;System.Char&gt;" /> into a <see cref="T:System.Buffers.StandardFormat" /> instance using <see cref="F:System.Buffers.StandardFormat.NoPrecision" /> precision.
Returns A value whose <see cref="P:System.Buffers.StandardFormat.Symbol" /> property value is the character in <paramref name="format" /> and whose <see cref="P:System.Buffers.StandardFormat.Precision" /> property value is <see cref="F:System.Buffers.StandardFormat.NoPrecision" /> .
format A read-only span that contains the character to parse.
public static StandardFormat
Parse​(string format)
Converts a classic .NET standard format string to a <see cref="T:System.Buffers.StandardFormat" /> instance.
Returns A format.
format A classic .NET standard format string.
public string
ToString​()
Returns the string representation of this format.
Returns The string representation of this format.
public static bool
TryParse​(ReadOnlySpan<​char> format, StandardFormat& result)
protected void
Finalize​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object