I see some people write:
//wordList is List<string>
wordList.ForEach(delegate(string word){ Console.WriteLine(word);});
instead of:
foreach(string word in wordList)
{
Console.WriteLine(word);
}
What is the advantage in doing so. Also I couldn't fathom the Action delegate syntax given above though I have used delegates in C# 2.0. Basically I am not able to relate the syntax with the concept of delegates I am familiar with. Can you please help me understand the syntax. Is it some shorthand?