c# - Know when first and last loop in foreach -


is there way find out when i'm @ first , last loop on foreach?

foreach(string str in list){   if(str.isfirst(list) == true){...}    if(str.islast(list) == true){...}  } 

^ this?

for (int = 0; < list.length; i++) {     if (i == 0)      {          // first iteration      }     if (i >= list.length - 1)      {          // last iteration      } } 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -