Answers for "c# foreach 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
4

c# foreach enum

enum Foos {
  Foo,
  Bar,
}

foreach(Foos val in Enum.GetValues(typeof(Foos))) {}
Posted by: Guest on October-07-2020
6

enum foreach

foreach (Suit suit in (Suit[]) Enum.GetValues(typeof(Suit)))
{
}
Posted by: Guest on March-23-2020

C# Answers by Framework

Browse Popular Code Answers by Language