Getting an enum back from string





3
Date Submitted Tue. Jun. 13th, 2006 3:21 PM
Revision 1 of 1
Helper gbarendt
Tags enum | String | VB.NET
Comments 0 comments
Given a string, you can return an Enum value

Originally found at http://codeproject.com/dotnet/EnumTips.asp?df=100&forumid=38264&exp=0&select=797671
MyEnumVal = CType(System.Enum.Parse(GetType(MyEnum), "gamma"), MyEnum)

Greg Barendt

Comments

There are currently no comments for this snippet.

Voting