Get all the members values of an enum
suggest changeenum MyEnum
{
One,
Two,
Three
}
foreach(MyEnum e in Enum.GetValues(typeof(MyEnum)))
Console.WriteLine(e);
This will print:
One
Two
Three
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents