IntPtr.ToString Method

Definition

将当前 IntPtr 对象的数值转换为其等效字符串表示形式。Converts the numeric value of the current IntPtr object to its equivalent string representation.

Overloads

ToString()

将当前 IntPtr 对象的数值转换为其等效字符串表示形式。Converts the numeric value of the current IntPtr object to its equivalent string representation.

ToString(IFormatProvider)
ToString(String)

将当前 IntPtr 对象的数值转换为其等效字符串表示形式。Converts the numeric value of the current IntPtr object to its equivalent string representation.

ToString(String, IFormatProvider)

ToString()

将当前 IntPtr 对象的数值转换为其等效字符串表示形式。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 -> string
Public Overrides Function ToString () As String

Returns

String

此实例的值的字符串表示形式。The string representation of the value of this instance.

Remarks

如果此实例的 Size 属性的值为4,则此方法等效于 Int32.ToString;否则,此方法等效于 Int64.ToStringIf 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.

ToString(IFormatProvider)

public:
 System::String ^ ToString(IFormatProvider ^ provider);
public string ToString (IFormatProvider provider);
override this.ToString : IFormatProvider -> string
Public Function ToString (provider As IFormatProvider) As String

Parameters

provider
IFormatProvider

Returns

String

ToString(String)

将当前 IntPtr 对象的数值转换为其等效字符串表示形式。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);
override this.ToString : string -> string
Public Function ToString (format As String) As String

Parameters

format
String

控制当前 IntPtr 对象转换方式的格式规范。A format specification that governs how the current IntPtr object is converted.

Returns

String

当前 IntPtr 对象的值的字符串表示形式。The string representation of the value of the current IntPtr object.

Remarks

如果 format 参数 null 或空字符串(""),则返回值使用常规格式说明符("G")进行格式设置。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

ToString(String, IFormatProvider)

public:
 virtual System::String ^ ToString(System::String ^ format, IFormatProvider ^ provider);
public string ToString (string format, IFormatProvider provider);
override this.ToString : string * IFormatProvider -> string
Public Function ToString (format As String, provider As IFormatProvider) As String

Parameters

format
String
provider
IFormatProvider

Returns

String

Implements

Applies to