about enum

  • Thread starter Thread starter tony
  • Start date Start date
T

tony

Hello!

If you have this enum test declaration can see get the number of items in
this enum.
In this case it's 6.

Can I use some suitable metods or some statement to get this 6 in some way.

enum test : byte {a,b,c,d,e,f};

//Tony
 
You could use the Enum.GetNames(typeof(test)) method and then examine
the Length property of the resulting string[].

Regards,

Jono
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

about enum 3
enum type 3
Merge Info From Two Enums 1
[Flags] Enum -- make it better 1
Enums & Constructors? 4
I have small probalem 4
Have some problem with enum and string 8
Expression in enum 4

Back
Top