<分区>
Possible Duplicate:
How does foreach work when looping through function results?
如果我有如下功能 - ReturnParts() 会在 foreach 循环中的每次迭代中被调用,还是只会被调用一次?
private void PrintParts()
{
foreach(string part in ReturnParts())
{
// Do Something or other.
}
}
private string[] ReturnParts()
{
// Build up and return an array.
}