Solved

enum question

Posted on 2011-02-19
2
422 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now