ToString Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Returns a string that represents the current object.

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

abstract ToString : unit -> string 
override ToString : unit -> string 

Return Value

Type: System..::..String
A string that represents the current object.

ToString is the major formatting method in the .NET Framework. It converts an object to its string representation so that it is suitable for display.

The default implementation of the ToString method returns the fully qualified name of the type of the Object.

Because Object is the base class of all reference types in the .NET Framework, this behavior is inherited by reference types that do not override the ToString method.

Types commonly override the ToString method to return a string that represents the object instance. For example, the base types such as Char, Int32, and String provide ToString implementations that return the string form of the value that the object represents.

Show: