foreach in enum c# code example
Example 1: enum foreach
foreach (Suit suit in (Suit[]) Enum.GetValues(typeof(Suit)))
{
}
Example 2: c# foreach enum
enum Foos {
Foo,
Bar,
}
foreach(Foos val in Enum.GetValues(typeof(Foos))) {}
Example 3: c# list.foreach
List<string> someList = <some way to init>
someList.ForEach(delegate(string s) {
<process the string>
});