Enum.Format Method converts enumerated type to string representation according to the specified format.
Enum Colors
Red
Green
Blue
Yellow
End Enum
Public Class FormatTest
Public Shared Sub Main()
Dim myColor As Colors = Colors.Blue
Console.WriteLine([Enum].Format(GetType(Colors), myColor, "d"))
Console.WriteLine([Enum].Format(GetType(Colors), myColor, "x"))
End Sub
End Class
Related examples in the same category