how to apply foreach to list in c# code example Example: c# list foreach someList.ForEach(x => { if(x.RemoveMe) someList.Remove(x); });