Compartir a través de


IFormattable.ToString Method

Formats the value of the current object with the specified format.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

public string ToString (
         stringformat,
         IFormatProviderformatProvider
)

Parameters

  • format
    The String object that specifies the format you want to use.

    -or-

    A null reference, which will obtain the default format defined for the type of the IFormattable implementation.

  • formatProvider
    The IFormatProvider object you want to use to format the value.

    -or-

    A null reference, which will obtain the numeric format information from the current locale setting for the operating system.

Return Value

The String object that contains the value of the current object with the specified format.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, and 4.1.

See Also

Reference

IFormattable Interface
IFormattable Members
System Namespace