I will use two strings with difference character case to compare with each others as shown below:
So this sample will show if these two string are the same or not. We use one Button with Click_Event then pop up the message with condition below.
Dim String1 As String = "I LIke Vb pRoGrame"
Dim String2 As String = "I Like VB Programe"
If String.Compare(String1, String2, True) = 0 Then
MsgBox("Strings Match")
Else
MsgBox("Strings do not Match")
End If
- String1 = "I LIke Vb pRoGrame"
- String1 = "I Like VB Programe"
So this sample will show if these two string are the same or not. We use one Button with Click_Event then pop up the message with condition below.
Dim String1 As String = "I LIke Vb pRoGrame"
Dim String2 As String = "I Like VB Programe"
If String.Compare(String1, String2, True) = 0 Then
MsgBox("Strings Match")
Else
MsgBox("Strings do not Match")
End If
- As you see the result, although these two strings are difference Character Case but they are the same words.
0 comments:
Post a Comment