for ....
dim str1 as string ="9:00"
dim str2 as string ="9:00"if str1= str2
exit for 
end if用什么方法判断str1 、str2是否相等,我的exit for 跳不出来,请指点,谢谢

解决方案 »

  1.   

    试下直接用值来代替变量str2行不行
    if str1 = "9:00"
    行的话就是变量赋值的问题咯
      

  2.   

    好久没写vb了
    ,你试试
    去掉字符串的前后空格。
    判断语句好像是
    if a=b then

    end if
      

  3.   

    可以跳出的:
    Dim str1 As String = "9:00"
    Dim str2 As String = "9:00"
    Dim i As Integer
    For i = 1 To 10
        If str1 = str2 Then
            Exit For
        End If
    Next
      

  4.   

    For i = 1 To 10
    Dim str1 As String = "9:00"
    Dim str2 As String = "9:00"
    If str1.Equals(str2) Then
            Exit For
        End If
    Next
    没问题