Is it possible to do a For…Each Loop Backwards?

前端 未结 13 2196
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 03:53

I don\'t believe this is possible by conventional methods, but something like this verbose code:

For Each s As String In myStringList Step -1
    //\' Do stu         


        
13条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 04:41

    Sadly, the MSDN docs on For Each state that the For Each construct is there explicitly for cases where the order of the iteration is unimportant (unordered sets and the like). So there is unfortunately no concept of reversing a For Each, as the order is not defined anyway.

    Good luck!

提交回复
热议问题