PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.ClickDim strInput AsArray'make array variableDim strResult1 AsString'text variableDim strResult2 AsString'another text variableTry
strInput =Split(TextBox1.Text, " ")'split the textbox if there is space.'you can also use chr(32) to replace " "
strResult1 = strInput(0)'split first text
strResult2 = strInput(1)'split second textMsgBox(strResult1 + strResult2)'combine first and second text with no spaceCatch ex As Exception
Test the code, type space character between 2 words :
What we have done here?
We have 2 words with a space character (“jenni” and “fer”)
We split those words using “Split” command into array, the process is identified with space character, so we had 2 lines.
We combine those words back together in one line, but this time with no space character in it.