I want to do something different with the last loop iteration when performing \'foreach\' on an object. I\'m using Ruby but the same goes for C#, Java etc.
Remove the last one from the list and retain its avlue.
Spec spec = specs.Find(s=>s.Value == 'C'); if (spec != null) { specs.Remove(spec); } foreach(Spec spec in specs) { }