Monday, 12 March 2012 string equals()?

How to string equals() in
I this tutorial you can learn how to get a string equals (compare to string)  declare first string and second string and compare using if condition  
Open Microsoft visual studio 2010 or any older version also may differ commands
Open file new project(ctrl+shift+n)àselect windows form applicationà rename as you wish
Drag and drop two label, textbox, and one button
Label1.textà1st string
Label2.textà2nd string
Copy and paste the following code
    Public Class Form1
    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        Dim ststring As String = TextBox1.Text
        Dim ndbstring As String = TextBox2.Text
        If String.Equals(ststring, ndbstring) Then
            MessageBox.Show("string are equals")
            MessageBox.Show("strings are not equals")
        End If

    End Sub
End Class


No comments:

Post a Comment