Iterating through a enum

  • Thread starter Thread starter Simon Hart
  • Start date Start date
S

Simon Hart

Is this possible?

I have a load of items defined in a enum. I simply want to check if a string
variable if defined in anyone of those enum items. Don't want to have to use
if statement.

Regards
Simon.
 
Simon said:
Is this possible?

I have a load of items defined in a enum. I simply want to check if a string
variable if defined in anyone of those enum items. Don't want to have to use
if statement.

Use Enum.IsDefined.

Jon
 

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


Back
Top