Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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