In C#/VB.NET/.NET, which loop runs faster, for or foreach?
for
foreach
Ever since I read that a for loop works faster than a foreach
It is what you do inside the loop that affects perfomance, not the actual looping construct (assuming your case is non-trivial).