comparing strings in vb

前端 未结 6 811
南方客
南方客 2021-01-17 08:06

Hopefully this should be an easy question. In java i think it\'s compareTo().

How do I compare 2 string variables to determine if they are the same?

6条回答
  •  再見小時候
    2021-01-17 08:38

    I know this has been answered, but in VB.net above 2013 (the lowest I've personally used) you can just compare strings with an = operator. This is the easiest way.

    So basically:

    If string1 = string2 Then
        'do a thing
    End If
    

提交回复
热议问题