Comparing Two Strings Using VB.Net


This tutorial is all about Comparing Two Strings Using VB.Net. With this tutorial you can Comparing Two Strings Using VB.Net. easily. So let’s get started:

  • First is open the Visual Basic, Select File on the menu, then click New and create a new project.

  • Then a New Project Dialog will appear. You can rename your project, depending on what you like to name it. After that click OK

  • Design your form like this just like what I’ve shown you below.
    Add a Button, and 2 Textbox.
  • After Designing your form, Add this code to the button.
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2. Dim word1 As String = TextBox1.TextDim word2 As String = TextBox2.TextIf String.Compare(word1, word2, True) = 0 Then
    4. MsgBox("Strings Match")
    6. Else
    8. MsgBox("Strings Do not Match")
    10. End If
    11. End Sub
  • Finally, Click F5 to run Program.

If you have any comments or suggestion about onComparing Two Strings Using VB.Net, Please Feel Free to contact our webpage.

Download Comparing Two Strings Using VB.Net Code Here



Other articles you might read also:





Facebook Comments


Please enter your comment!
Please enter your name here