Check whether a string is not equal to any of a list of strings

后端 未结 4 1684
野性不改
野性不改 2021-02-19 06:29

Is there a way to convert some code like this:

If someString <> \"02\" And someString <> \"03\" And someString <> \"06\" And someString <>         


        
4条回答
  •  余生分开走
    2021-02-19 07:08

    Dim invalidvalues As New List(Of String) From { _
        "02", _
        "03,", _
        "04", _
        "07" _
    }
    
    If invalidvalues.Contains(x) Then
        btnButton.Enabled = False
    End If
    

提交回复
热议问题