From the course: Visual Basic Essential Training

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Concatenation and interpolation

Concatenation and interpolation - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Concatenation and interpolation

- [Instructor] To compose a string means to create a single string by combining multiple pieces of text variables or values. There are various ways to accomplish this. We'll start by linking at concatenation. First, let's look at, take a look at my UI. So I have these two text boxes up here. This one is called TextBox, or I should say TeamATextBox. And this one, its name is TeamBTextBox. So my goal is to grab the strings that are in those text boxes. That's what I'm doing on line 40 and 41. Then I'm going to combine those together. The first technique is using the oldest weight of concatenating a string, and that is using these operators, the plus operator or the ampersand operator, they're equivalent. So you can use either one. So I start by creating a string literal, that's what's here at the beginning, and then I terminate that literal, and then I take this variable and I concatenate it to the end, and then I take the next string literal and concatenate that to this variable and so…

Contents