Enum.GetNames

  • Thread starter Thread starter J. Marcelo Barbieri
  • Start date 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,
 
Marcelo try something like this:

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

Console.WriteLine (t);

HTH,

Sasha Imamovich
 
Back
Top