Does anyone know how to transform a enum value to a human readable value?
For example:
ThisIsValueA should be ‘This is Value A’.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Converting this from a vb code snippet that a certain Ian Horwill left at a blog post long ago… i’ve since used this in production successfully.
(requires, ‘using System.Text.RegularExpressions;’)
Thus:
Would return,
It’s much simpler, and less redundant than providing Description attributes.
Attributes are useful here only if you need to provide a layer of indirection (which the question didn’t ask for).