C# Enum GetTypeCode
Description
Enum GetTypeCode
returns the underlying TypeCode for
this instance.
Syntax
Enum.GetTypeCode
has the following syntax.
public TypeCode GetTypeCode()
Returns
Enum.GetTypeCode
method returns The type for this instance.
Example
The following code shows how to use Enum.GetTypeCode
.
/* w w w . j av a2s .co m*/
using System;
enum Colors { Red, Green, Blue, Yellow };
public class FormatTest {
public static void Main() {
Colors myColor = Colors.Blue;
Console.WriteLine(myColor.GetTypeCode());
}
}
The code above generates the following result.