csharp for loop last iteration

Code Example - csharp for loop last iteration

                
                        // I want to find out the last iteration of a for loop in c#

for (var i=0; i<myList.Count; i++)
{
   if (i==myList.Count-1)
   {
      // this is the last item in the list
   }
}