Tuesday, January 25, 2011

Joining a string to another string, also known as string concatenation, in Visual Basic

To join a string to another string, also known as string concatenation in Visual Basic you would use the & between strings in double quotes.
1:  Dim quote1 as string
2: Dim part1 as string = "How many legs "
3: Dim part2 as string = "does that frog have?"
4: quote1 = part1 & part2
which produces the output
How many legs does that frog have?

No comments:

Post a Comment