I'm a little unsure of deferred execution in the following scenario. How often is the IEnumerable Linq expression evaluated in the following fragment? Would I be better off assigning it to a local variable before the foreach loop?
foreach (var x in y.Where(s => s.Length > 0))
{
// do something
}
// where y is, for example, an IEnumerable<string>