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 representing the name of the current Type.

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

Syntax

'Declaration
Public Overrides Function ToString As String
public override string ToString()
public:
virtual String^ ToString() override
abstract ToString : unit -> string 
override ToString : unit -> string 
public override function ToString() : String

Return Value

Type: System. . :: . .String
A String representing the name of the current Type.

Remarks

This method returns the fully qualified common language runtime namespace and name for all primitive types. For example, the C# instruction, (long)0.Type().ToString() returns "System.Int64" instead of merely "Int64".

If the current Type represents a generic type, the type and its type arguments are qualified by namespace and by nested type, but not by assembly. If the current Type represents a type parameter in the definition of a generic type or generic method, this method returns the unqualified name of the type parameter.

.NET Framework Security

See Also

Reference

Type Class

System Namespace