Прочетете на английски Редактиране

Споделяне чрез


NFloat.Parse Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Parse(String)

Converts the string representation of a number to its floating-point number equivalent.

Parse(ReadOnlySpan<Byte>, IFormatProvider)

Parses a span of UTF-8 characters into a value.

Parse(ReadOnlySpan<Char>, IFormatProvider)

Parses a span of characters into a value.

Parse(String, NumberStyles)

Converts the string representation of a number in a specified style to its floating-point number equivalent.

Parse(String, IFormatProvider)

Converts the string representation of a number in a specified culture-specific format to its floating-point number equivalent.

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

Parses a span of UTF-8 characters into a value.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Converts a character span that contains the string representation of a number in a specified style and culture-specific format to its floating-point number equivalent.

Parse(String, NumberStyles, IFormatProvider)

Converts the string representation of a number in a specified style and culture-specific format to its floating-point number equivalent.

Parse(String)

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

Converts the string representation of a number to its floating-point number equivalent.

C#
public static System.Runtime.InteropServices.NFloat Parse(string s);

Parameters

s
String

A string that contains the number to convert.

Returns

A floating-point number that is equivalent to the numeric value or symbol specified in s.

Exceptions

s does not represent a number in a valid format.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Parse(ReadOnlySpan<Byte>, IFormatProvider)

Source:
NFloat.cs
Source:
NFloat.cs

Parses a span of UTF-8 characters into a value.

C#
public static System.Runtime.InteropServices.NFloat Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider);

Parameters

utf8Text
ReadOnlySpan<Byte>

The span of UTF-8 characters to parse.

provider
IFormatProvider

An object that provides culture-specific formatting information about utf8Text.

Returns

The result of parsing utf8Text.

Implements

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8, 9, 10

Parse(ReadOnlySpan<Char>, IFormatProvider)

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

Parses a span of characters into a value.

C#
public static System.Runtime.InteropServices.NFloat Parse(ReadOnlySpan<char> s, IFormatProvider? provider);

Parameters

s
ReadOnlySpan<Char>

The span of characters to parse.

provider
IFormatProvider

An object that provides culture-specific formatting information about s.

Returns

The result of parsing s.

Implements

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Parse(String, NumberStyles)

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

Converts the string representation of a number in a specified style to its floating-point number equivalent.

C#
public static System.Runtime.InteropServices.NFloat Parse(string s, System.Globalization.NumberStyles style);

Parameters

s
String

A string that contains the number to convert.

style
NumberStyles

A bitwise combination of enumeration values that indicate the style elements that can be present in s.

Returns

A floating-point number that is equivalent to the numeric value or symbol specified in s.

Exceptions

style is not a NumberStyles value.

-or-

style includes the AllowHexSpecifier value.

s does not represent a number in a valid format.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Parse(String, IFormatProvider)

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

Converts the string representation of a number in a specified culture-specific format to its floating-point number equivalent.

C#
public static System.Runtime.InteropServices.NFloat Parse(string s, IFormatProvider? provider);

Parameters

s
String

A string that contains the number to convert.

provider
IFormatProvider

An object that supplies culture-specific formatting information about s.

Returns

A floating-point number that is equivalent to the numeric value or symbol specified in s.

Implements

Exceptions

s does not represent a number in a valid format.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

Source:
NFloat.cs
Source:
NFloat.cs

Parses a span of UTF-8 characters into a value.

C#
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);

Parameters

utf8Text
ReadOnlySpan<Byte>

The span of UTF-8 characters to parse.

style
NumberStyles

A bitwise combination of number styles that can be present in utf8Text.

provider
IFormatProvider

An object that provides culture-specific formatting information about utf8Text.

Returns

The result of parsing utf8Text.

Implements

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8, 9, 10

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

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

Converts a character span that contains the string representation of a number in a specified style and culture-specific format to its floating-point number equivalent.

C#
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);

Parameters

s
ReadOnlySpan<Char>

A character span that contains the number to convert.

style
NumberStyles

A bitwise combination of enumeration values that indicate the style elements that can be present in s.

provider
IFormatProvider

An object that supplies culture-specific formatting information about s.

Returns

A floating-point number that is equivalent to the numeric value or symbol specified in s.

Implements

Exceptions

style is not a NumberStyles value.

-or-

style includes the AllowHexSpecifier value.

s does not represent a number in a valid format.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Parse(String, NumberStyles, IFormatProvider)

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

Converts the string representation of a number in a specified style and culture-specific format to its floating-point number equivalent.

C#
public static System.Runtime.InteropServices.NFloat Parse(string s, System.Globalization.NumberStyles style, IFormatProvider? provider);

Parameters

s
String

A string that contains the number to convert.

style
NumberStyles

A bitwise combination of enumeration values that indicate the style elements that can be present in s.

provider
IFormatProvider

An object that supplies culture-specific formatting information about s.

Returns

A floating-point number that is equivalent to the numeric value or symbol specified in s.

Implements

Exceptions

style is not a NumberStyles value.

-or-

style includes the AllowHexSpecifier value.

s does not represent a number in a valid format.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10