Thursday 12 July 2007

Neat way of Enumerating Enum's

Stumbled across this method of enumerating an enum. V. handy...

foreach (anEnumType enumValue in Enum.GetValues(typeof(anEnumType)))
{
Console.WriteLine(enumValue .ToString());
}

2 comments:

Anonymous said...

Excellent! So simple!

Meteoroz said...

Thanks buddy.