Parse a string to an Enum value in VB.NET

Dim val = DirectCast([Enum].Parse(GetType(Gender), "Male"), Gender)

Leave a Comment