Mono Class Library: System.Enum Overview | Members

System.Enum.ToString Method

Converts the numeric value of the current instance to its equivalent string representation using the specified format. [Edit]

[System.Obsolete("Provider is ignored, just use ToString")]
public string ToString (string format, IFormatProvider provider)

Parameters

format
A string that specifies the format to use when converting the current instance to a string . Specify one of the following values in upper or lower case: "G", "D", "X", or "F" . [Edit]
provider
An object that implements the IFormatProvider interface or a null reference. The IFormatProvider is not used in the implementation of this method.
Note: There is no IFormatProvider that corresponds to a Enum object; therefore, provider is not utilized by this method, and any IFormatProvider may be passed as a parameter.
[Edit]
format
Documentation for this section has not yet been entered. [Edit]
provider
Documentation for this section has not yet been entered. [Edit]

Returns

The string representation of the value of the current instance as specified by format. [Edit]

Exceptions

TypeReason
FormatExceptionformat does not contain a valid format specifier. [Edit]

Remarks

If format is a null reference or an empty string, the return value is formatted using the general format specifier ("G").

Note:

For details on the format specifiers used with an enumeration object, see Enum.Format(Type, object, string) .

This method is implemented to support the IFormattable interface.

[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0