enum loop
enum Foos {
Foo,
Bar,
}
foreach(Foos val in Enum.GetValues(typeof(Foos))) {
//Do whatever with the value :D
}
enum loop
enum Foos {
Foo,
Bar,
}
foreach(Foos val in Enum.GetValues(typeof(Foos))) {
//Do whatever with the value :D
}
loop over all values in enum
var values = Enum.GetValues(typeof(Foos)).Cast<Foos>();
loop over enum values
var values = Enum.GetValues(typeof(EnumName));
foreach (var value in values)
{
Combobox.Items.Add(value.ToString());
}
how to loop through a python enum
from enum import Enum
class Country(Enum):
Afghanistan = 93
Albania = 355
Algeria = 213
Andorra = 376
Angola = 244
Antarctica = 672
for data in Country:
print('{:15} = {}'.format(data.name, data.value))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us