Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / C#

Human readable strings for enum elements

Rate me:
Please Sign up or sign in to vote.
4.43/5 (11 votes)
12 Aug 2010CPOL 20.3K   10  
Using enum really helps readability, but the values within the enum must understandably conform to the rules for variables names. This is fine until you need to display enum values to the user. This tip shows you how to associate and access a human readable string with each enum element.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO
Wales Wales
Born at an early age, he grew older. At the same time, his hair grew longer, and was tied up behind his head.
Has problems spelling the word "the".
Invented the portable cat-flap.
Currently, has not died yet. Or has he?

Comments and Discussions