Mono Class Library: System.Enum Overview | Members

System.Enum.ToString Method

Converts the value of the current instance to its equivalent string representation using the specified format.

public string ToString (string format)

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 lowercase: "G", "D", "X", or "F" .

Returns

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

Exceptions

TypeReason
FormatExceptionformat contains an invalid value.

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) .

Requirements

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