Skip to content

Instantly share code, notes, and snippets.

@liammclennan
Created March 24, 2011 07:33
Show Gist options
  • Save liammclennan/884704 to your computer and use it in GitHub Desktop.
Save liammclennan/884704 to your computer and use it in GitHub Desktop.
Enumeration Behaviour
[Test]
public void CollectionTests()
{
var letterList = new List<string>
{
"a","b"
};
IEnumerable<string> letters = letterList.Select(l =>
{
var s = new String(l.ToCharArray());
Console.WriteLine("selecting");
return s;
});
foreach (var letter in letters)
Console.WriteLine(letter);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment