C#, detect last element when iterating over an IEnumerable 2020-08-30 A couple of extension methods that returns an IEnumerable<(T value, bool isLast)> where isLast is set to true on the last iteration.