Enum.GetNames

  • Thread starter J. Marcelo Barbieri
  • Start date
J

J. Marcelo Barbieri

a.. How can I return all the values in a enumerator. I tried like the
following, but it doesn't work and there are no examples in the VS Help:
enum test {a, b, c}
Console.WriteLine(Enum.GetNames(test));
thanks,
 
S

Sasha Imamovich

Marcelo try something like this:

foreach(string t in Enum.GetNames (typeof(test)))

Console.WriteLine (t);

HTH,

Sasha Imamovich
 

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

Top