Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a break line between concatenated strings in VB.net

I am trying to concatenate the output of various functions into a textbox, but it all comes up in one biiig line. How can I insert break lines in between the variables? I have something like this:

Me.TextBox.text = output1 + output2

And I would like to have something like this:

Me.TextBox.text = output1 + ENTER + output2

Any ideas?

Thanks!

like image 283
TuxMeister Avatar asked Sep 11 '09 14:09

TuxMeister


2 Answers

The Environment.NewLine read-only variable is what you want to use. There's also vbCrLf, but this is for legacy purposes and not environment-dependant.

Try the following:

Me.TextBox.Text = output1 + Environment.NewLine + output2
like image 139
Noldorin Avatar answered Oct 04 '22 04:10

Noldorin


Me.TextBox.text = output1 & Environment.NewLine & output2

Also use & to concat strings vb.net, + is legacy support

like image 33
Pondidum Avatar answered Oct 04 '22 02:10

Pondidum