IntPtr.ToString 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.
Converts the numeric value of the current IntPtr object to its equivalent string representation.
Overloads
| ToString() | Converts the numeric value of the current IntPtr object to its equivalent string representation. | 
| ToString(IFormatProvider) | Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. | 
| ToString(String) | Converts the numeric value of the current IntPtr object to its equivalent string representation. | 
| ToString(String, IFormatProvider) | Formats the value of the current instance using the specified format. | 
ToString()
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
Converts the numeric value of the current IntPtr object to its equivalent string representation.
public:
 override System::String ^ ToString();public override string ToString();override this.ToString : unit -> stringPublic Overrides Function ToString () As StringReturns
The string representation of the value of this instance.
Remarks
If the value of the Size property for this instance is 4, then this method is equivalent to Int32.ToString; otherwise, this method is equivalent to Int64.ToString.
Applies to
ToString(IFormatProvider)
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
public:
 System::String ^ ToString(IFormatProvider ^ provider);public string ToString(IFormatProvider? provider);override this.ToString : IFormatProvider -> stringPublic Function ToString (provider As IFormatProvider) As StringParameters
- provider
- IFormatProvider
An object that supplies culture-specific formatting information.
Returns
The string representation of the value of this instance as specified by provider.
Applies to
ToString(String)
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
Converts the numeric value of the current IntPtr object to its equivalent string representation.
public:
 System::String ^ ToString(System::String ^ format);public string ToString(string format);public string ToString(string? format);override this.ToString : string -> stringPublic Function ToString (format As String) As StringParameters
Returns
The string representation of the value of the current IntPtr object.
Exceptions
format is invalid or not supported.
Remarks
If the format parameter is null or an empty string (""), the return value is formatted with the general format specifier ("G"). For more information about numeric format specifiers, see the Standard Numeric Format Strings topic.
The return value is formatted using the invariant culture.
See also
- InvariantCulture
- Standard Numeric Format Strings
- Custom Numeric Format Strings
- Formatting Types in .NET
Applies to
ToString(String, IFormatProvider)
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
- Source:
- IntPtr.cs
Formats the value of the current instance using the specified format.
public:
 virtual System::String ^ ToString(System::String ^ format, IFormatProvider ^ provider);public string ToString(string? format, IFormatProvider? provider);override this.ToString : string * IFormatProvider -> stringPublic Function ToString (format As String, provider As IFormatProvider) As StringParameters
- format
- String
The format to use.
-or-
A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.
- provider
- IFormatProvider
An object that supplies culture-specific formatting information.
Returns
The value of the current instance in the specified format.