[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

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


0
panJames
Asked:
panJames
  • 2
1 Solution
 
Praveen KumarArchitectCommented:
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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now