foreach (var x in things) { //Do stuff if (x == things.Last()) // Do Stuff only for the last item }
int iteration=0; foreach (var item in items) { iteration++; if (iteration < items.Count) { //do stuff } }