Get all the members values of an enum C# with Example



Get all the members values of an enum C# with Example

enum MyEnum 
{ 
One, 
Two, 
Three 
} 
foreach(MyEnum e in Enum.GetValues(typeof(MyEnum))) 
Console.WriteLine(e); 
This will print: 
One 
Two 
Three 

0 Comment's

Comment Form