G
Guest
I'm having a hard time comparing two strings - even if the strings are
identical, the If x <> y Then condition is always met. I'm going crazy.
Here's my code:
Dim x As String = "a"
Dim y As String = "a"
If x <> y Then
' it always goes here
End If
I also tried:
If Not (x = y) Then
and
Dim theSame As Boolean
theSame = x Like y
If Not(theSame) Then ' If theSame=False Then gives the same result
' always goes here
End If
with no success. Can you tell me what I'm doing wrong? Thank you very much.
identical, the If x <> y Then condition is always met. I'm going crazy.
Here's my code:
Dim x As String = "a"
Dim y As String = "a"
If x <> y Then
' it always goes here
End If
I also tried:
If Not (x = y) Then
and
Dim theSame As Boolean
theSame = x Like y
If Not(theSame) Then ' If theSame=False Then gives the same result
' always goes here
End If
with no success. Can you tell me what I'm doing wrong? Thank you very much.