Created
March 24, 2011 07:33
-
-
Save liammclennan/884704 to your computer and use it in GitHub Desktop.
Enumeration Behaviour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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