C# Type ToString
Description
Type ToString
returns a String representing the name
of the current Type.
Syntax
Type.ToString
has the following syntax.
public override string ToString()
Returns
Type.ToString
method returns A String representing the name of the current Type.
Example
This following example demonstrates a use of the Namespace and Module properties and the ToString method of Type.
using System;// w w w .j ava2 s. c o m
namespace MyNamespace
{
class MyClass
{
}
}
public class Example
{
public static void Main()
{
Type myType = typeof(MyNamespace.MyClass);
Console.WriteLine(" Fully qualified name: {0}.", myType.ToString());
}
}
The code above generates the following result.