The &operator

I just read again today the claim that you should use + for string concatenation in VB.  You should NOT.  Just because you can doesn’t mean you should.  VB has the Concatenation operator & as distinct from the + operator. Yes for the most part adding two strings is the same as concatenating them, but adding two variables is very different from concatenating them… that’s why in a dynamic language it is important to have two different operators.

The correct one to use is & for concatenation, and use + for addition.  So for strings use &.

See my previous blog entries on this for more details….

1 Comment so far

  1.   Roger Jennings on June 25th, 2007          


    You got me on this one. Mea culpa.

    See the update at