Thursday, April 28, 2011

How to get the count of enumerations?

How to get the count of total values defined in an enumeration?

From stackoverflow
  • Enum.GetNames(typeof(SomeEnum)).Length;
    
    Robert Koritnik : @Umar: sorry. I've been writing my answer (and checking MSDN at the same time) you already added your comments at the top. Thanks for accepting my answer as well. +1 on your question for that.

0 comments:

Post a Comment