how to compare two string in .net

Posted by Shanky11 under C# on 4/5/2013 | Points: 10 | Views : 949 | Status : [Member] | Replies : 1
Dim str1 As String = "ppp"
Dim str2 As String = "ppP"
Dim res As Int64 = String.Compare(str1, str2)
Label1.Text = "First result:" + res.ToString()
this return 1
but 1 means true then why its returning 1 rather than it sholud return 0




Responses

Posted by: Satyapriyanayak on: 4/5/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Public Class Form3

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str1 As String = "ppp"
Dim str2 As String = "ppP"
Dim res As Int64 = String.Compare(str1, str2, True)
Label1.Text = "First result::" + res.ToString()
End Sub
End Class

If this post helps you mark it as answer
Thanks

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response