“LifeAfterYield” (Problem)
What will the following code display?
IEnumerable<string> Foo()
{
yield return "Bar";
Console.WriteLine("Baz");
}
void Main()
{
foreach (var str in Foo())
Console.Write(str);
}
Last updated
Was this helpful?
What will the following code display?
IEnumerable<string> Foo()
{
yield return "Bar";
Console.WriteLine("Baz");
}
void Main()
{
foreach (var str in Foo())
Console.Write(str);
}
Last updated
Was this helpful?