UIntPtr.Parse 方法

定义

重载

Parse(String)

将数字的字符串表示形式转换为它的等效无符号本机整数。Converts the string representation of a number to its unsigned native integer equivalent.

Parse(String, NumberStyles)

将指定样式的数字的字符串表示形式转换为它的等效无符号本机整数。Converts the string representation of a number in a specified style to its unsigned native integer equivalent.

Parse(String, IFormatProvider)

将指定区域性特定格式的数字的字符串表示形式转换为它的等效无符号本机整数。Converts the string representation of a number in a specified culture-specific format to its unsigned native integer equivalent.

Parse(String, NumberStyles, IFormatProvider)

将指定样式和区域性特定格式的数字的字符串表示形式转换为它的等效无符号本机整数。Converts the string representation of a number in a specified style and culture-specific format to its unsigned native integer equivalent.

Parse(String)

将数字的字符串表示形式转换为它的等效无符号本机整数。Converts the string representation of a number to its unsigned native integer equivalent.

public:
 static UIntPtr Parse(System::String ^ s);
public static UIntPtr Parse (string s);
static member Parse : string -> unativeint
Public Shared Function Parse (s As String) As UIntPtr

参数

s
String

包含要转换的数字的字符串。A string containing a number to convert.

返回

UIntPtr

s 中包含的数字等效的无符号本机整数。An unsigned native integer equivalent to the number contained in s.

例外

snulls is null.

s 的格式不正确。s is not in the correct format.

s 表示一个小于 MinValue 或大于 MaxValue 的数字。s represents a number less than MinValue or greater than MaxValue.

Parse(String, NumberStyles)

将指定样式的数字的字符串表示形式转换为它的等效无符号本机整数。Converts the string representation of a number in a specified style to its unsigned native integer equivalent.

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

参数

s
String

包含要转换的数字的字符串。A string containing a number to convert.

style
NumberStyles

枚举值的按位组合,用于指示可出现在 s 中的样式元素。A bitwise combination of the enumeration values that indicates the style elements that can be present in s.

返回

UIntPtr

s 中包含的数字等效的无符号本机整数。An unsigned native integer equivalent to the number contained in s.

例外

snulls is null.

style 不是 NumberStyles 值,或 style 不是 AllowHexSpecifierHexNumber 值的组合。style is not a NumberStyles value or style is not a combination of AllowHexSpecifier and HexNumber values.

s 的格式不正确。s is not in the correct format.

s 表示一个小于 MinValue 或大于 MaxValue 的数字。s represents a number less than MinValue or greater than MaxValue.

Parse(String, IFormatProvider)

将指定区域性特定格式的数字的字符串表示形式转换为它的等效无符号本机整数。Converts the string representation of a number in a specified culture-specific format to its unsigned native integer equivalent.

public:
 static UIntPtr Parse(System::String ^ s, IFormatProvider ^ provider);
public static UIntPtr Parse (string s, IFormatProvider? provider);
static member Parse : string * IFormatProvider -> unativeint
Public Shared Function Parse (s As String, provider As IFormatProvider) As UIntPtr

参数

s
String

包含要转换的数字的字符串。A string containing a number to convert.

provider
IFormatProvider

一个对象,提供有关 s 的区域性特定格式设置信息。An object that supplies culture-specific formatting information about s.

返回

UIntPtr

s 中包含的数字等效的无符号本机整数。An unsigned native integer equivalent to the number contained in s.

例外

snulls is null.

s 的格式不正确。s is not in the correct format.

s 表示一个小于 MinValue 或大于 MaxValue 的数字。s represents a number less than MinValue or greater than MaxValue.

Parse(String, NumberStyles, IFormatProvider)

将指定样式和区域性特定格式的数字的字符串表示形式转换为它的等效无符号本机整数。Converts the string representation of a number in a specified style and culture-specific format to its unsigned native integer equivalent.

public:
 static UIntPtr Parse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider);
public static UIntPtr Parse (string s, System.Globalization.NumberStyles style, IFormatProvider? provider);
static member Parse : string * System.Globalization.NumberStyles * IFormatProvider -> unativeint
Public Shared Function Parse (s As String, style As NumberStyles, provider As IFormatProvider) As UIntPtr

参数

s
String

包含要转换的数字的字符串。A string containing a number to convert.

style
NumberStyles

枚举值的按位组合,用于指示可出现在 s 中的样式元素。A bitwise combination of the enumeration values that indicates the style elements that can be present in s.

provider
IFormatProvider

一个对象,提供有关 s 的区域性特定格式设置信息。An object that supplies culture-specific formatting information about s.

返回

UIntPtr

s 中包含的数字等效的无符号本机整数。An unsigned native integer equivalent to the number contained in s.

例外

snulls is null.

style 不是 NumberStyles 值,或 style 不是 AllowHexSpecifierHexNumber 值的组合。style is not a NumberStyles value or style is not a combination of AllowHexSpecifier and HexNumber values.

s 的格式不正确。s is not in the correct format.

s 表示一个小于 MinValue 或大于 MaxValue 的数字。s represents a number less than MinValue or greater than MaxValue.

适用于