If I use:
var strings = new List { \"sample\" };
foreach (string s in strings)
{
Console.WriteLine(s);
strings.Add(s + \"!\");
}
Because the ForEach attached to the List class internally uses a for loop that is directly attached to its internal members -- which you can see by downloading the source code for the .NET framework.
http://referencesource.microsoft.com/netframework.aspx
Where as a foreach loop is first and foremost a compiler optimization but also must operate against the collection as an observer -- so if the collection is modified it throws an exception.