I am trying to compare two strings in VB but compareTo, compare, equals etc all give compile errors.
If String.Compare(string_one, string_two) = 0 Then
'...do stuff
End If
If String.Equals(string_one, string_two) Then
'...do stuff
End If
Now both lines give me the error,
Compile error:
Expected: (
and it highlights the dot after String, i.e.
String.(whatever)
______↑__________
Do I need to include something, I normally program C, Java and C# so I am not very familiar with VB
Now I am doing this in a very crappy program that uses Microsoft Visual Basic 6.5 is it that these functions just simply do not exist?
VB6 just uses the = operator:
For that matter you do it that way in VB.Net as well, though vb.net also allows the .Equals() function in this form: