c# check if element is last in list

85

@razor identify last foreach -

int iteration=0;
foreach (var item in items)
  {
    iteration++;
    if (iteration < items.Count)
       {
        //do stuff  
       }              
   }

Comments

Submit
0 Comments