For this enumeration,
Enum MyEnum
Value
End Enum
there are two methods to get the name representation Value
of MyEnum.Value
:
[Enum].GetName(GetType(MyEnum), MyEnum.Value) ' aka Enum.GetName
and
Dim a As MyEnum = MyEnum.Value
a.ToString ' aka Enum.ToString
What are their pros and cons? And which is better after all?
PS: There is one answer for java but this is .NET which may have different functionality.