VB.NET - How to move to next item a For Each Loop?

后端 未结 6 1995
后悔当初
后悔当初 2020-12-13 22:50

Is there a statment like Exit For, except instead of exiting the loop it just moves to the next item.

For example:

For          


        
6条回答
  •  天命终不由人
    2020-12-13 23:45

    I want to be clear that the following code is not good practice. You can use GOTO Label:

    For Each I As Item In Items
    
        If I = x Then
           'Move to next item
            GOTO Label1
        End If
    
        ' Do something
        Label1:
    Next
    

提交回复
热议问题