NFloat.Parse 方法

定义

重载

Parse(String, NumberStyles, IFormatProvider)

将指定样式和区域性特定格式的数字的字符串表示形式转换为其等效的浮点数。

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

将包含指定样式和区域性特定格式的数字的字符串表示形式的字符范围转换为其等效的浮点数。

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

将 UTF-8 字符范围分析为值。

Parse(String, IFormatProvider)

将指定区域性特定格式的数字的字符串表示形式转换为其等效的浮点数。

Parse(String)

将数字的字符串表示形式转换为其等效的浮点数。

Parse(ReadOnlySpan<Char>, IFormatProvider)

将字符范围解析为值。

Parse(ReadOnlySpan<Byte>, IFormatProvider)

将 UTF-8 字符范围分析为值。

Parse(String, NumberStyles)

将指定样式的数字的字符串表示形式转换为其等效的浮点数。

Parse(String, NumberStyles, IFormatProvider)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

将指定样式和区域性特定格式的数字的字符串表示形式转换为其等效的浮点数。

public:
 static System::Runtime::InteropServices::NFloat Parse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider) = System::Numerics::INumberBase<System::Runtime::InteropServices::NFloat>::Parse;
public static System.Runtime.InteropServices.NFloat Parse (string s, System.Globalization.NumberStyles style, IFormatProvider? provider);
static member Parse : string * System.Globalization.NumberStyles * IFormatProvider -> System.Runtime.InteropServices.NFloat
Public Shared Function Parse (s As String, style As NumberStyles, provider As IFormatProvider) As NFloat

参数

s
String

包含要转换的数字的字符串。

style
NumberStyles

枚举值的按位组合,用于指示可出现在 s 中的样式元素。

provider
IFormatProvider

一个对象,提供有关 s 的区域性特定格式设置信息。

返回

一个浮点数,等效于 中指定的 s数值或符号。

实现

例外

style 不是 NumberStyles 值。

style 包括 AllowHexSpecifier 值。

snull

s 不表示具有有效格式的数字。

适用于

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

将包含指定样式和区域性特定格式的数字的字符串表示形式的字符范围转换为其等效的浮点数。

public static System.Runtime.InteropServices.NFloat Parse (ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.Float, IFormatProvider? provider = default);
static member Parse : ReadOnlySpan<char> * System.Globalization.NumberStyles * IFormatProvider -> System.Runtime.InteropServices.NFloat
Public Shared Function Parse (s As ReadOnlySpan(Of Char), Optional style As NumberStyles = System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.Float, Optional provider As IFormatProvider = Nothing) As NFloat

参数

s
ReadOnlySpan<Char>

包含要转换的数字的字符范围。

style
NumberStyles

枚举值的按位组合,用于指示可出现在 s 中的样式元素。

provider
IFormatProvider

一个对象,提供有关 s 的区域性特定格式设置信息。

返回

一个浮点数,等效于 中指定的 s数值或符号。

实现

例外

style 不是 NumberStyles 值。

style 包括 AllowHexSpecifier 值。

s 不表示具有有效格式的数字。

适用于

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

Source:
NFloat.cs
Source:
NFloat.cs

将 UTF-8 字符范围分析为值。

public static System.Runtime.InteropServices.NFloat Parse (ReadOnlySpan<byte> utf8Text, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.Float, IFormatProvider? provider = default);
static member Parse : ReadOnlySpan<byte> * System.Globalization.NumberStyles * IFormatProvider -> System.Runtime.InteropServices.NFloat
Public Shared Function Parse (utf8Text As ReadOnlySpan(Of Byte), Optional style As NumberStyles = System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.Float, Optional provider As IFormatProvider = Nothing) As NFloat

参数

utf8Text
ReadOnlySpan<Byte>

要分析的 UTF-8 字符的跨度。

style
NumberStyles

可以存在于 中的 utf8Text数字样式的按位组合。

provider
IFormatProvider

一个对象,提供有关 utf8Text 的区域性特定格式设置信息。

返回

分析 utf8Text的结果。

实现

适用于

Parse(String, IFormatProvider)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

将指定区域性特定格式的数字的字符串表示形式转换为其等效的浮点数。

public:
 static System::Runtime::InteropServices::NFloat Parse(System::String ^ s, IFormatProvider ^ provider) = IParsable<System::Runtime::InteropServices::NFloat>::Parse;
public static System.Runtime.InteropServices.NFloat Parse (string s, IFormatProvider? provider);
static member Parse : string * IFormatProvider -> System.Runtime.InteropServices.NFloat
Public Shared Function Parse (s As String, provider As IFormatProvider) As NFloat

参数

s
String

包含要转换的数字的字符串。

provider
IFormatProvider

一个对象,提供有关 s 的区域性特定格式设置信息。

返回

一个浮点数,等效于 中指定的 s数值或符号。

实现

例外

snull

s 不表示具有有效格式的数字。

适用于

Parse(String)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

将数字的字符串表示形式转换为其等效的浮点数。

public:
 static System::Runtime::InteropServices::NFloat Parse(System::String ^ s);
public static System.Runtime.InteropServices.NFloat Parse (string s);
static member Parse : string -> System.Runtime.InteropServices.NFloat
Public Shared Function Parse (s As String) As NFloat

参数

s
String

包含要转换的数字的字符串。

返回

一个浮点数,等效于 中指定的 s数值或符号。

例外

snull

s 不表示具有有效格式的数字。

适用于

Parse(ReadOnlySpan<Char>, IFormatProvider)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

将字符范围解析为值。

public:
 static System::Runtime::InteropServices::NFloat Parse(ReadOnlySpan<char> s, IFormatProvider ^ provider) = ISpanParsable<System::Runtime::InteropServices::NFloat>::Parse;
public static System.Runtime.InteropServices.NFloat Parse (ReadOnlySpan<char> s, IFormatProvider? provider);
static member Parse : ReadOnlySpan<char> * IFormatProvider -> System.Runtime.InteropServices.NFloat
Public Shared Function Parse (s As ReadOnlySpan(Of Char), provider As IFormatProvider) As NFloat

参数

s
ReadOnlySpan<Char>

要分析的字符范围。

provider
IFormatProvider

一个对象,提供有关 s 的区域性特定格式设置信息。

返回

分析 s的结果。

实现

适用于

Parse(ReadOnlySpan<Byte>, IFormatProvider)

Source:
NFloat.cs
Source:
NFloat.cs

将 UTF-8 字符范围分析为值。

public:
 static System::Runtime::InteropServices::NFloat Parse(ReadOnlySpan<System::Byte> utf8Text, IFormatProvider ^ provider) = IUtf8SpanParsable<System::Runtime::InteropServices::NFloat>::Parse;
public static System.Runtime.InteropServices.NFloat Parse (ReadOnlySpan<byte> utf8Text, IFormatProvider? provider);
static member Parse : ReadOnlySpan<byte> * IFormatProvider -> System.Runtime.InteropServices.NFloat
Public Shared Function Parse (utf8Text As ReadOnlySpan(Of Byte), provider As IFormatProvider) As NFloat

参数

utf8Text
ReadOnlySpan<Byte>

要分析的 UTF-8 字符的跨度。

provider
IFormatProvider

一个对象,提供有关 utf8Text 的区域性特定格式设置信息。

返回

分析 utf8Text的结果。

实现

适用于

Parse(String, NumberStyles)

Source:
NFloat.cs
Source:
NFloat.cs
Source:
NFloat.cs

将指定样式的数字的字符串表示形式转换为其等效的浮点数。

public:
 static System::Runtime::InteropServices::NFloat Parse(System::String ^ s, System::Globalization::NumberStyles style);
public static System.Runtime.InteropServices.NFloat Parse (string s, System.Globalization.NumberStyles style);
static member Parse : string * System.Globalization.NumberStyles -> System.Runtime.InteropServices.NFloat
Public Shared Function Parse (s As String, style As NumberStyles) As NFloat

参数

s
String

包含要转换的数字的字符串。

style
NumberStyles

枚举值的按位组合,用于指示可出现在 s 中的样式元素。

返回

一个浮点数,等效于 中指定的 s数值或符号。

例外

style 不是 NumberStyles 值。

style 包括 AllowHexSpecifier 值。

snull

s 不表示具有有效格式的数字。

适用于