Redigeeri

Jagamisviis:


IntPtr.TryParse Method

Definition

Overloads

TryParse(ReadOnlySpan<Byte>, IntPtr)

Tries to convert a UTF-8 character span containing the string representation of a number to its signed integer equivalent.

TryParse(ReadOnlySpan<Char>, IntPtr)

Converts the read-only span of characters representation of a number to its signed native integer equivalent. A return value indicates whether the conversion succeeded.

TryParse(String, IntPtr)

Converts the string representation of a number to its signed native integer equivalent. A return value indicates whether the conversion succeeded.

TryParse(ReadOnlySpan<Byte>, IFormatProvider, IntPtr)

Tries to parse a span of UTF-8 characters into a value.

TryParse(ReadOnlySpan<Char>, IFormatProvider, IntPtr)

Tries to parse a string into a value.

TryParse(String, IFormatProvider, IntPtr)

Tries to parse a string into a value.

TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, IntPtr)

Tries to parse a span of UTF-8 characters into a value.

TryParse(String, NumberStyles, IFormatProvider, IntPtr)

Converts the string representation of a number in a specified style and culture-specific format to its signed native integer equivalent. A return value indicates whether the conversion succeeded.

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, IntPtr)

Converts the read-only span of characters representation of a number in a specified style and culture-specific format to its signed native integer equivalent. A return value indicates whether the conversion succeeded.

TryParse(ReadOnlySpan<Byte>, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs

Tries to convert a UTF-8 character span containing the string representation of a number to its signed integer equivalent.

public:
 static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, [Runtime::InteropServices::Out] IntPtr % result);
public static bool TryParse (ReadOnlySpan<byte> utf8Text, out IntPtr result);
static member TryParse : ReadOnlySpan<byte> * nativeint -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), ByRef result As IntPtr) As Boolean

Parameters

utf8Text
ReadOnlySpan<Byte>

A span containing the UTF-8 characters representing the number to convert.

result
IntPtr

nativeint

When this method returns, contains the signed integer value equivalent to the number contained in utf8Text if the conversion succeeded, or zero if the conversion failed. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if utf8Text was converted successfully; otherwise, false.

Applies to

TryParse(ReadOnlySpan<Char>, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

Converts the read-only span of characters representation of a number to its signed native integer equivalent. A return value indicates whether the conversion succeeded.

public:
 static bool TryParse(ReadOnlySpan<char> s, [Runtime::InteropServices::Out] IntPtr % result);
public static bool TryParse (ReadOnlySpan<char> s, out IntPtr result);
static member TryParse : ReadOnlySpan<char> * nativeint -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), ByRef result As IntPtr) As Boolean

Parameters

s
ReadOnlySpan<Char>

A read-only span of characters containing a number to convert.

result
IntPtr

nativeint

When this method returns, contains the signed native integer equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is empty, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if s was converted successfully; otherwise, false.

Applies to

TryParse(String, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

Converts the string representation of a number to its signed native integer equivalent. A return value indicates whether the conversion succeeded.

public:
 static bool TryParse(System::String ^ s, [Runtime::InteropServices::Out] IntPtr % result);
public static bool TryParse (string? s, out IntPtr result);
static member TryParse : string * nativeint -> bool
Public Shared Function TryParse (s As String, ByRef result As IntPtr) As Boolean

Parameters

s
String

A string containing a number to convert.

result
IntPtr

nativeint

When this method returns, contains the signed native integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or empty, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if s was converted successfully; otherwise, false.

Applies to

TryParse(ReadOnlySpan<Byte>, IFormatProvider, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs

Tries to parse a span of UTF-8 characters into a value.

public:
 static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, IFormatProvider ^ provider, [Runtime::InteropServices::Out] IntPtr % result) = IUtf8SpanParsable<IntPtr>::TryParse;
public static bool TryParse (ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out IntPtr result);
static member TryParse : ReadOnlySpan<byte> * IFormatProvider * nativeint -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), provider As IFormatProvider, ByRef result As IntPtr) As Boolean

Parameters

utf8Text
ReadOnlySpan<Byte>

The span of UTF-8 characters to parse.

provider
IFormatProvider

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

result
IntPtr

nativeint

On return, contains the result of successfully parsing utf8Text or an undefined value on failure.

Returns

true if utf8Text was successfully parsed; otherwise, false.

Applies to

TryParse(ReadOnlySpan<Char>, IFormatProvider, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

Tries to parse a string into a value.

public:
 static bool TryParse(ReadOnlySpan<char> s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] IntPtr % result) = ISpanParsable<IntPtr>::TryParse;
public static bool TryParse (ReadOnlySpan<char> s, IFormatProvider? provider, out IntPtr result);
static member TryParse : ReadOnlySpan<char> * IFormatProvider * nativeint -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), provider As IFormatProvider, ByRef result As IntPtr) As Boolean

Parameters

s
ReadOnlySpan<Char>

A read-only span of characters containing a number to convert.

provider
IFormatProvider

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

result
IntPtr

nativeint

When this method returns, contains the result of successfully parsing s or an undefined value on failure.

Returns

true if s was converted successfully; otherwise, false.

Applies to

TryParse(String, IFormatProvider, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

Tries to parse a string into a value.

public:
 static bool TryParse(System::String ^ s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] IntPtr % result) = IParsable<IntPtr>::TryParse;
public static bool TryParse (string? s, IFormatProvider? provider, out IntPtr result);
static member TryParse : string * IFormatProvider * nativeint -> bool
Public Shared Function TryParse (s As String, provider As IFormatProvider, ByRef result As IntPtr) As Boolean

Parameters

s
String

The string to parse.

provider
IFormatProvider

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

result
IntPtr

nativeint

When this method returns, contains the result of successfully parsing s or an undefined value on failure.

Returns

true if s was successfully parsed; otherwise, false.

Applies to

TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs

Tries to parse a span of UTF-8 characters into a value.

public:
 static bool TryParse(ReadOnlySpan<System::Byte> utf8Text, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] IntPtr % result) = System::Numerics::INumberBase<IntPtr>::TryParse;
public static bool TryParse (ReadOnlySpan<byte> utf8Text, System.Globalization.NumberStyles style, IFormatProvider? provider, out IntPtr result);
static member TryParse : ReadOnlySpan<byte> * System.Globalization.NumberStyles * IFormatProvider * nativeint -> bool
Public Shared Function TryParse (utf8Text As ReadOnlySpan(Of Byte), style As NumberStyles, provider As IFormatProvider, ByRef result As IntPtr) As Boolean

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.

result
IntPtr

nativeint

On return, contains the result of successfully parsing utf8Text or an undefined value on failure.

Returns

true if utf8Text was successfully parsed; otherwise, false.

Applies to

TryParse(String, NumberStyles, IFormatProvider, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

Converts the string representation of a number in a specified style and culture-specific format to its signed native integer equivalent. A return value indicates whether the conversion succeeded.

public:
 static bool TryParse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] IntPtr % result);
public:
 static bool TryParse(System::String ^ s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] IntPtr % result) = System::Numerics::INumberBase<IntPtr>::TryParse;
public static bool TryParse (string? s, System.Globalization.NumberStyles style, IFormatProvider? provider, out IntPtr result);
static member TryParse : string * System.Globalization.NumberStyles * IFormatProvider * nativeint -> bool
Public Shared Function TryParse (s As String, style As NumberStyles, provider As IFormatProvider, ByRef result As IntPtr) As Boolean

Parameters

s
String

A string containing a number to convert. The string is interpreted using the style specified by style.

style
NumberStyles

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

provider
IFormatProvider

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

result
IntPtr

nativeint

When this method returns, contains the signed native integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or empty, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if s was converted successfully; otherwise, false.

Applies to

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

Converts the read-only span of characters representation of a number in a specified style and culture-specific format to its signed native integer equivalent. A return value indicates whether the conversion succeeded.

public:
 static bool TryParse(ReadOnlySpan<char> s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] IntPtr % result);
public:
 static bool TryParse(ReadOnlySpan<char> s, System::Globalization::NumberStyles style, IFormatProvider ^ provider, [Runtime::InteropServices::Out] IntPtr % result) = System::Numerics::INumberBase<IntPtr>::TryParse;
public static bool TryParse (ReadOnlySpan<char> s, System.Globalization.NumberStyles style, IFormatProvider? provider, out IntPtr result);
static member TryParse : ReadOnlySpan<char> * System.Globalization.NumberStyles * IFormatProvider * nativeint -> bool
Public Shared Function TryParse (s As ReadOnlySpan(Of Char), style As NumberStyles, provider As IFormatProvider, ByRef result As IntPtr) As Boolean

Parameters

s
ReadOnlySpan<Char>

A read-only span of characters containing a number to convert. The string is interpreted using the style specified by style.

style
NumberStyles

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

provider
IFormatProvider

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

result
IntPtr

nativeint

When this method returns, contains the signed native integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is empty, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if s was converted successfully; otherwise, false.

Applies to