enum question

Hello experts :-)

enum Letters
{
   aaa,
   bbb,
   ccc
}

string a;
Letters letters;

a = "aaa";
letters = a;  //<- how can I do it?

Thank you

panJames


panJamesAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Praveen KumarConnect With a Mentor ArchitectCommented:
string a;
Letters letters;

a = "aaa";
letters = (Letters)Enum.Parse(typeof(Letters), a, true);
0
 
Praveen KumarArchitectCommented:
Last boolean value (true above) is for Ignore case or not.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.