StandardFormat 结构

定义

表示不使用实际字符串的标准格式字符串。Represents a standard format string without using an actual string.

public value class StandardFormat : IEquatable<System::Buffers::StandardFormat>
public struct StandardFormat : IEquatable<System.Buffers.StandardFormat>
type StandardFormat = struct
Public Structure StandardFormat
Implements IEquatable(Of StandardFormat)
继承
StandardFormat
实现

注解

StandardFormat 对象由单个字符标准格式说明符(如 "G"、"d" 或 "X")和一个可选的精度说明符组成。A StandardFormat object consists of a single character standard format specifier (such as 'G', 'D', or 'X') and an optional precision specifier. 精度说明符的范围可以介于0到9之间,也可以是特殊 StandardFormat.NoPrecision 值。The precision specifier can range from 0 to 9, or it can be the special StandardFormat.NoPrecision value.

构造函数

StandardFormat(Char, Byte)

初始化 StandardFormat 结构的新实例。Initializes a new instance of the StandardFormat structure.

字段

MaxPrecision

定义最大的有效精度值。Defines the maximum valid precision value.

NoPrecision

指示某个格式不使用精度或未指定精度。Indicates that a format doesn't use a precision or that the precision is unspecified.

属性

HasPrecision

获取一个值,该值指示格式是否已定义精度。Gets a value that indicates whether a format has a defined precision.

IsDefault

获取一个值,该值指示当前实例是否是默认格式。Gets a value that indicates whether the current instance is a default format.

Precision

获取格式的精度组件。Gets the precision component of the format.

Symbol

获取格式的字符组件。Gets the character component of the format.

方法

Equals(Object)

返回一个值,该值指示指定的对象是否是与当前对象相等的 StandardFormat 对象。Returns a value that indicates whether the specified object is a StandardFormat object that is equal to the current instance.

Equals(StandardFormat)

返回一个值,该值指示指定的 StandardFormat 是否与当前实例相等。Returns a value that indicates whether the specified StandardFormat is equal to the current instance.

GetHashCode()

返回此实例的哈希代码。Returns the hash code for this instance.

Parse(ReadOnlySpan<Char>)

ReadOnlySpan<System.Char> 转换为使用 NoPrecision 精度的 StandardFormat 实例。Converts a ReadOnlySpan<System.Char> into a StandardFormat instance using NoPrecision precision.

Parse(String)

将经典 .NET 标准格式将字符串转换为 StandardFormat 实例。Converts a classic .NET standard format string to a StandardFormat instance.

ToString()

返回此格式的字符串表示形式。Returns the string representation of this format.

TryParse(ReadOnlySpan<Char>, StandardFormat)

尝试将 ReadOnlySpan<Char> 转换为 StandardFormat 实例并返回一个值,该值指示分析操作是否成功。Attempts to convert a ReadOnlySpan<Char> to a StandardFormat instance and returns a value that indicates whether the parsing operation succeeded.

运算符

Equality(StandardFormat, StandardFormat)

返回一个值,该值指示两个 StandardFormat 实例是否相等。Returns a value that indicates whether two StandardFormat instances are equal.

Implicit(Char to StandardFormat)

将字符转换为使用 NoPrecision 精度的 StandardFormat 实例。Converts a character to a StandardFormat instance using NoPrecision precision.

Inequality(StandardFormat, StandardFormat)

确定两个 StandardFormat 实例是否不相等。Determines whether two StandardFormat instances are unequal.

适用于