Enum value ToString: G F D X
Public Enum Color
Red = 1
Blue = 2
Green = 3
End Enum
Public Module Example
Public Sub Main()
Dim myColor As Color = Color.Green
Console.WriteLine("The value of myColor is {0}.", myColor.ToString("G"))
Console.WriteLine("The value of myColor is {0}.", myColor.ToString("F"))
Console.WriteLine("The value of myColor is {0}.", myColor.ToString("D"))
Console.WriteLine("The value of myColor is 0x{0}.", myColor.ToString("X"))
End Sub
End Module
Related examples in the same category