我有一个foreach循环声明了一个从未使用过的变量,但我不知道如何绕过它。
foreach (string i in stringCollection){ some other stuff }
我从不使用“i”-但循环中需要一个迭代器。那么,如何消除这个错误呢?
foreach for
foreach
for
for (int i = 0; i < stringCollection.Count; i++) { some other stuff }