「VB.net入門」ExitでFor Each文のサンプル

サンプルコード

	Sub Main()
		Dim city() As String = {"tokyo", "oosaka", "yokohama","kawasaki"} 
		
		For Each cft As String In city
			If cft = "yokohama" Then
				Exit For
			End If
			//some code
		Next
	End Sub

 

VB.net

Posted by arkgame