Answers for "enum get all values C#"

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
2

c# iterate enum

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

enum get all values C#

//typed
var values = Enum.GetValues(typeof(Foos)).Cast<Foos>()
Posted by: Guest on April-28-2021

C# Answers by Framework

Browse Popular Code Answers by Language