IntPtr.Parse Method

Definition

Overloads

Parse(String)

Converts the string representation of a number to its signed native integer equivalent.

Parse(ReadOnlySpan<Char>, IFormatProvider)
Parse(String, NumberStyles)

Converts the string representation of a number in a specified style to its signed native integer equivalent.

Parse(String, IFormatProvider)

Converts the string representation of a number in a specified culture-specific format to its signed native integer equivalent.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

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.

Parse(String, NumberStyles, IFormatProvider)

Converts the string representation of a number in a specified style and culture-specific format to its signed native integer equivalent.

Parse(String)

Converts the string representation of a number to its signed native integer equivalent.

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

Parameters

s
String

A string containing a number to convert.

Returns

IntPtr

nativeint

A signed native integer equivalent to the number contained in s.

Exceptions

s is not in the correct format.

s represents a number less than MinValue or greater than MaxValue.

Applies to

Parse(ReadOnlySpan<Char>, IFormatProvider)

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

Parameters

provider
IFormatProvider

Returns

IntPtr

nativeint

Implements

Applies to

Parse(String, NumberStyles)

Converts the string representation of a number in a specified style to its signed native integer equivalent.

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

Parameters

s
String

A string containing a number to convert.

style
NumberStyles

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

Returns

IntPtr

nativeint

A signed native integer equivalent to the number contained in s.

Exceptions

style is not a NumberStyles value or style is not a combination of AllowHexSpecifier and HexNumber values.

s is not in the correct format.

s represents a number less than MinValue or greater than MaxValue.

Applies to

Parse(String, IFormatProvider)

Converts the string representation of a number in a specified culture-specific format to its signed native integer equivalent.

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

Parameters

s
String

A string containing a number to convert.

provider
IFormatProvider

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

Returns

IntPtr

nativeint

A signed native integer equivalent to the number contained in s.

Implements

Exceptions

s is not in the correct format.

s represents a number less than MinValue or greater than MaxValue.

Applies to

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

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.

public static IntPtr Parse (ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, IFormatProvider? provider = default);
static member Parse : ReadOnlySpan<char> * System.Globalization.NumberStyles * IFormatProvider -> nativeint
Public Shared Function Parse (s As ReadOnlySpan(Of Char), Optional style As NumberStyles = System.Globalization.NumberStyles.Integer, Optional provider As IFormatProvider = Nothing) As IntPtr

Parameters

s
ReadOnlySpan<Char>

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

style
NumberStyles

A bitwise combination of the 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.

Returns

IntPtr

nativeint

A signed native integer equivalent to the number contained in s.

Implements

Exceptions

style is not a NumberStyles value or style is not a combination of AllowHexSpecifier and HexNumber values.

s is not in the correct format.

s represents a number less than MinValue or greater than MaxValue.

Applies to

Parse(String, NumberStyles, IFormatProvider)

Converts the string representation of a number in a specified style and culture-specific format to its signed native integer equivalent.

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

Parameters

s
String

A string containing a number to convert.

style
NumberStyles

A bitwise combination of the 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.

Returns

IntPtr

nativeint

A signed native integer equivalent to the number contained in s.

Implements

Exceptions

style is not a NumberStyles value or style is not a combination of AllowHexSpecifier and HexNumber values.

s is not in the correct format.

s represents a number less than MinValue or greater than MaxValue.

Applies to