Solved

enum question

Posted on 2011-02-19
2
424 Views
Last Modified: 2012-06-21
Hello experts :-)

enum Letters
{
   aaa,
   bbb,
   ccc
}

string a;
Letters letters;

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

Thank you

panJames


0
Comment
Question by:panJames
  • 2
2 Comments
 
LVL 12

Accepted Solution

by:
Mamtha1982 earned 500 total points
ID: 34933142
string a;
Letters letters;

a = "aaa";
letters = (Letters)Enum.Parse(typeof(Letters), a, true);
0
 
LVL 12

Expert Comment

by:Mamtha1982
ID: 34933148
Last boolean value (true above) is for Ignore case or not.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question