Export (0) Print
Expand All
Expand Minimize
0 out of 2 rated this helpful - Rate this topic

Type.ToString Method

Returns a String representing the name of the current Type.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
abstract ToString : unit -> string  
override ToString : unit -> string

Return Value

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

Implements

_Type.ToString()

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.

This following example demonstrates a use of the Namespace and Module properties and the ToString method of Type.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.