UIntPtr.TryParse 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
TryParse(String, IFormatProvider, UIntPtr) |
尝试将字符串解析为值。 |
TryParse(ReadOnlySpan<Char>, UIntPtr) |
将数字的只读字符表示形式转换为其等效的无符号本机整数。 一个指示转换是否成功的返回值。 |
TryParse(String, UIntPtr) |
将数字的字符串表示形式转换为它的等效无符号本机整数。 一个指示转换是否成功的返回值。 |
TryParse(ReadOnlySpan<Byte>, IFormatProvider, UIntPtr) |
尝试将 UTF-8 字符范围解析为值。 |
TryParse(ReadOnlySpan<Char>, IFormatProvider, UIntPtr) |
尝试将字符串解析为值。 |
TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, UIntPtr) |
尝试将 UTF-8 字符范围解析为值。 |
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, UIntPtr) |
将指定样式和区域性特定格式的数字的只读字符表示形式转换为其等效的无符号本机整数。 一个指示转换是否成功的返回值。 |
TryParse(ReadOnlySpan<Byte>, UIntPtr) |
尝试将包含数字字符串表示形式的 UTF-8 字符范围转换为其等效的无符号整数。 |
TryParse(String, NumberStyles, IFormatProvider, UIntPtr) |
将指定样式和区域性特定格式的数字的字符串表示形式转换为它的等效无符号本机整数。 一个指示转换是否成功的返回值。 |
TryParse(String, IFormatProvider, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
尝试将字符串解析为值。
public:
static bool TryParse(System::String ^ s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] UIntPtr % result) = IParsable<UIntPtr>::TryParse;
public static bool TryParse (string? s, IFormatProvider? provider, out UIntPtr result);
static member TryParse : string * IFormatProvider * unativeint -> bool
Public Shared Function TryParse (s As String, provider As IFormatProvider, ByRef result As UIntPtr) As Boolean
参数
- s
- String
要分析的字符串。
- provider
- IFormatProvider
一个对象,提供有关 s
的区域性特定格式设置信息。
- result
-
UIntPtr
unativeint
此方法返回时,包含成功分析 s
的结果或失败时的未定义值。
返回
true
如果 s
已成功分析,则为 ;否则为 false
。
适用于
TryParse(ReadOnlySpan<Char>, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
将数字的只读字符表示形式转换为其等效的无符号本机整数。 一个指示转换是否成功的返回值。
public:
static bool TryParse(ReadOnlySpan<char> s, [Runtime::InteropServices::Out] UIntPtr % result);
public static bool TryParse (ReadOnlySpan<char> s, out UIntPtr result);
static member TryParse : ReadOnlySpan<char> * unativeint -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), ByRef result As UIntPtr) As Boolean
参数
- s
- ReadOnlySpan<Char>
包含要转换的数字的只读字符范围。
- result
-
UIntPtr
unativeint
当此方法返回时,如果转换成功,则包含与 s
中所包含的数字等效的无符号本机整数值;如果转换失败,则包含零。 如果 s
参数为空、格式不正确或表示小于 MinValue 或大于 MaxValue的数字,则转换失败。 此参数未经初始化即进行传递;最初在 result 中提供的任何值都会被覆盖。
返回
如果 true
成功转换,则为 s
;否则为 false
。
适用于
TryParse(String, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
将数字的字符串表示形式转换为它的等效无符号本机整数。 一个指示转换是否成功的返回值。
public:
static bool TryParse(System::String ^ s, [Runtime::InteropServices::Out] UIntPtr % result);
public static bool TryParse (string? s, out UIntPtr result);
static member TryParse : string * unativeint -> bool
Public Shared Function TryParse (s As String, ByRef result As UIntPtr) As Boolean
参数
- s
- String
包含要转换的数字的字符串。
- result
-
UIntPtr
unativeint
当此方法返回时,如果转换成功,则包含与 s
中所包含的数字等效的无符号本机整数值;如果转换失败,则包含零。 如果 s
参数为 null
或 为空、格式不正确或表示小于 MinValue 或大于 MaxValue的数字,则转换失败。 此参数未经初始化即进行传递;最初在 result 中提供的任何值都会被覆盖。
返回
如果 true
成功转换,则为 s
;否则为 false
。
适用于
TryParse(ReadOnlySpan<Byte>, IFormatProvider, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
尝试将 UTF-8 字符范围解析为值。
public:
static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, IFormatProvider ^ provider, [Runtime::InteropServices::Out] UIntPtr % result) = IUtf8SpanParsable<UIntPtr>::TryParse;
public static bool TryParse (ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out UIntPtr result);
static member TryParse : ReadOnlySpan<byte> * IFormatProvider * unativeint -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), provider As IFormatProvider, ByRef result As UIntPtr) As Boolean
参数
- utf8Text
- ReadOnlySpan<Byte>
要分析的 UTF-8 字符的跨度。
- provider
- IFormatProvider
一个对象,提供有关 utf8Text
的区域性特定格式设置信息。
- result
-
UIntPtr
unativeint
返回时,包含成功分析 utf8Text
的结果或失败时的未定义值。
返回
true
如果 utf8Text
已成功分析,则为 ;否则为 false
。
适用于
TryParse(ReadOnlySpan<Char>, IFormatProvider, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
尝试将字符串解析为值。
public:
static bool TryParse(ReadOnlySpan<char> s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] UIntPtr % result) = ISpanParsable<UIntPtr>::TryParse;
public static bool TryParse (ReadOnlySpan<char> s, IFormatProvider? provider, out UIntPtr result);
static member TryParse : ReadOnlySpan<char> * IFormatProvider * unativeint -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), provider As IFormatProvider, ByRef result As UIntPtr) As Boolean
参数
- s
- ReadOnlySpan<Char>
包含要转换的数字的只读字符范围。
- provider
- IFormatProvider
一个对象,提供有关 s
的区域性特定格式设置信息。
- result
-
UIntPtr
unativeint
此方法返回时,包含成功分析 s
的结果或失败时的未定义值。
返回
如果 true
成功转换,则为 s
;否则为 false
。
适用于
TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
尝试将 UTF-8 字符范围解析为值。
public:
static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] UIntPtr % result) = System::Numerics::INumberBase<UIntPtr>::TryParse;
public static bool TryParse (ReadOnlySpan<byte> utf8Text, System.Globalization.NumberStyles style, IFormatProvider? provider, out UIntPtr result);
static member TryParse : ReadOnlySpan<byte> * System.Globalization.NumberStyles * IFormatProvider * unativeint -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), style As NumberStyles, provider As IFormatProvider, ByRef result As UIntPtr) As Boolean
参数
- utf8Text
- ReadOnlySpan<Byte>
要分析的 UTF-8 字符的跨度。
- style
- NumberStyles
可以存在于 中的 utf8Text
数字样式的按位组合。
- provider
- IFormatProvider
一个对象,提供有关 utf8Text
的区域性特定格式设置信息。
- result
-
UIntPtr
unativeint
返回时,包含成功分析 utf8Text
的结果或失败时的未定义值。
返回
true
如果 utf8Text
已成功分析,则为 ;否则为 false
。
适用于
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
将指定样式和区域性特定格式的数字的只读字符表示形式转换为其等效的无符号本机整数。 一个指示转换是否成功的返回值。
public:
static bool TryParse(ReadOnlySpan<char> s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] UIntPtr % result);
public:
static bool TryParse(ReadOnlySpan<char> s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] UIntPtr % result) = System::Numerics::INumberBase<UIntPtr>::TryParse;
public static bool TryParse (ReadOnlySpan<char> s, System.Globalization.NumberStyles style, IFormatProvider? provider, out UIntPtr result);
static member TryParse : ReadOnlySpan<char> * System.Globalization.NumberStyles * IFormatProvider * unativeint -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), style As NumberStyles, provider As IFormatProvider, ByRef result As UIntPtr) As Boolean
参数
- s
- ReadOnlySpan<Char>
包含要转换的数字的只读字符范围。 该范围使用由 style
指定的样式来进行解释。
- style
- NumberStyles
枚举值的按位组合,用于指示可出现在 s
中的样式元素。
- provider
- IFormatProvider
一个对象,提供有关 s
的区域性特定格式设置信息。
- result
-
UIntPtr
unativeint
当此方法返回时,如果转换成功,则包含与 s
中所包含的数字等效的无符号本机整数值;如果转换失败,则包含零。 如果 s
参数为空、格式不正确或表示小于 MinValue 或大于 MaxValue的数字,则转换失败。 此参数未经初始化即进行传递;最初在 result 中提供的任何值都会被覆盖。
返回
如果 true
成功转换,则为 s
;否则为 false
。
适用于
TryParse(ReadOnlySpan<Byte>, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
尝试将包含数字字符串表示形式的 UTF-8 字符范围转换为其等效的无符号整数。
public:
static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, [Runtime::InteropServices::Out] UIntPtr % result);
public static bool TryParse (ReadOnlySpan<byte> utf8Text, out UIntPtr result);
static member TryParse : ReadOnlySpan<byte> * unativeint -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), ByRef result As UIntPtr) As Boolean
参数
- utf8Text
- ReadOnlySpan<Byte>
包含表示要转换的数字的 UTF-8 字符的跨度。
- result
-
UIntPtr
unativeint
此方法返回时,如果转换成功,则包含等效于 中包含的 utf8Text
数字的无符号整数值;如果转换失败,则包含零。 此参数未经初始化即进行传递;最初在 result 中提供的任何值都会被覆盖。
返回
如果 true
成功转换,则为 utf8Text
;否则为 false
。
适用于
TryParse(String, NumberStyles, IFormatProvider, UIntPtr)
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
- Source:
- UIntPtr.cs
将指定样式和区域性特定格式的数字的字符串表示形式转换为它的等效无符号本机整数。 一个指示转换是否成功的返回值。
public:
static bool TryParse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] UIntPtr % result);
public:
static bool TryParse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] UIntPtr % result) = System::Numerics::INumberBase<UIntPtr>::TryParse;
public static bool TryParse (string? s, System.Globalization.NumberStyles style, IFormatProvider? provider, out UIntPtr result);
static member TryParse : string * System.Globalization.NumberStyles * IFormatProvider * unativeint -> bool
Public Shared Function TryParse (s As String, style As NumberStyles, provider As IFormatProvider, ByRef result As UIntPtr) As Boolean
参数
- s
- String
包含要转换的数字的字符串。 该字符串使用由 style
指定的样式来进行解释。
- style
- NumberStyles
枚举值的按位组合,用于指示可出现在 s
中的样式元素。
- provider
- IFormatProvider
一个对象,提供有关 s
的区域性特定格式设置信息。
- result
-
UIntPtr
unativeint
当此方法返回时,如果转换成功,则包含与 s
中所包含的数字等效的无符号本机整数值;如果转换失败,则包含零。 如果 s
参数为 null
或 为空、格式不正确或表示小于 MinValue 或大于 MaxValue的数字,则转换失败。 此参数未经初始化即进行传递;最初在 result 中提供的任何值都会被覆盖。
返回
如果 true
成功转换,则为 s
;否则为 false
。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈