c# foreach inaczej code example
Example 1: c# foreach enum
enum Foos {
Foo,
Bar,
}
foreach(Foos val in Enum.GetValues(typeof(Foos))) {}
Example 2: c# list foreach
someList.ForEach(x => { if(x.RemoveMe) someList.Remove(x); });
enum Foos {
Foo,
Bar,
}
foreach(Foos val in Enum.GetValues(typeof(Foos))) {}
someList.ForEach(x => { if(x.RemoveMe) someList.Remove(x); });