Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Enum.IFormattable.ToString Method

.NET Framework 4.6 and 4.5

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Note: This API is now obsolete.

This method overload is obsolete; use Enum.ToString(String).

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

[ObsoleteAttribute("The provider argument is not used. Please use ToString(String).")]
string IFormattable.ToString(
	string format,
	IFormatProvider provider


Type: System.String

A format specification.

Type: System.IFormatProvider

Return Value

Type: System.String
The string representation of the value of this instance, as specified by format.


IFormattable.ToString(String, IFormatProvider)


format does not contain a valid format specification.


format equals "X", but the enumeration type is unknown.

This member is an explicit interface member implementation. It can be used only when the enumeration instance is cast to an IFormattable interface. The recommended alternative is to call the ToString(String) method.

Portable Class Library

Obsolete (compiler warning) in Portable Class Library
© 2015 Microsoft