Answers for "foreach in enums c#"

C#
5

c# foreach enum

enum Foos {
  Foo,
  Bar,
}

foreach(Foos val in Enum.GetValues(typeof(Foos))) {
  //Do whatever with the value :D
}
Posted by: Guest on October-07-2020
0

c# foreach enum

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

C# Answers by Framework

Browse Popular Code Answers by Language