有没有一种奇特的方法可以知道你在List中的最后一个循环中而不使用计数器
List<string> myList = new List<string>() {"are", "we", "there", "yet"};
foreach(string myString in myList) {
// Is there a fancy way to find out here if this is the last time through?
}
Run Code Online (Sandbox Code Playgroud)