Tuesday, 13 March 2012

vb.net string concat() ?


How to string concat() in vb.net?
I this tutorial you can learn how to cocat two given string (concat means combine two specified strings)
Syntax:
String.cocat(string  str1,string str2) As string
Ex: str.concat(str1,str2)
It will returns combine of two string
 To do this program following steps to be followed
Step1:
Open Microsoft visual studio 2010 or any older version also may differ commands
Step2:
Open file new project(ctrl+shift+n)àselect windows form applicationà rename as you wish
Step3:
Drag and drop two label, textbox, and one button
Label1.textà1st string
Label2.textà2nd string
Buttonàcheck
Step4:
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 firststring As String = TextBox1.Text
        Dim secondstring As String = TextBox2.Text
        MessageBox.Show(String.Concat(TextBox1.Text, TextBox2.Text))
    End Sub
End Class

 Output:


No comments:

Post a Comment