Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

loop through all enum values in C#

var values = Enum.GetValues(typeof(Foos));
foreach(Foos foo in values) {
	// do something, use foo
}

// or
foreach(Foos foo in Enum.GetValues(typeof(Foos))) {
	// do something, use foo
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #enum #values
ADD COMMENT
Topic
Name
4+9 =