beantownace
Active member
- Joined
- Feb 15, 2019
- Messages
- 42
- Programming Experience
- 5-10
Hello all,
Quick question and I should know this. If I have an IEnumerable and then below that a for loop if I need to set the last index to the Count of this IEnumerable should I get the count in a variable before the for loop where if I put like the code snippet below it would enumerate it each time the count?
Quick question and I should know this. If I have an IEnumerable and then below that a for loop if I need to set the last index to the Count of this IEnumerable should I get the count in a variable before the for loop where if I put like the code snippet below it would enumerate it each time the count?
ForLoop:
IEnumerable customers;
for(var i = 0; i < customers.Count(); i++)
{
}