Answers for "c# iterate enum"

C#
10

loop through an enum c#

public enum Days {
  Monday,
  Tuesday,
  Wednesday
}

foreach(Days day in Enum.GetValues(typeof(Days))) {
  
}
Posted by: Guest on May-21-2020
3

traversing an enum c#

var values = Enum.GetValues(typeof(Foos)).Cast<Foos>();
Posted by: Guest on April-14-2020
2

c# iterate enum

var values = Enum.GetValues(typeof(Foos));
Posted by: Guest on January-09-2021

C# Answers by Framework

Browse Popular Code Answers by Language