I second what Alex Says.
If I've got to concatinate two small strings, I usually just use &.
If I'm building a large string in a loop, System.Text.StringBuilder (I think
that's the right namespace) is the way to go by FAR.
Michael
Hello,
if you just concat two strings, you can safely use &.
If you concat more than two strings it is more performant to use
string.Concat.
In a loop, use the StringBuilder.
Greetings,
Henning Krause
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/?page=products)
> I second what Alex Says.
> If I've got to concatinate two small strings, I usually just use &.
[quoted text clipped - 17 lines]
> doing
> > string concatenation in VB.NET?
Jon Skeet [C# MVP] - 30 Jun 2004 08:21 GMT
> if you just concat two strings, you can safely use &.
> If you concat more than two strings it is more performant to use
> string.Concat.
I believe & just uses Concat under the hood anyway, doesn't it?
Note that string literals will be concatenated by the compiler anyway,
so "x" & "y" is exactly the same as "xy".

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Sriram Krishnan - 17 Jul 2004 15:28 GMT
See Rico Mariani's post on the subject
http://weblogs.asp.net/ricom/posts/40778.aspx

Signature
Sriram Krishnan
Microsoft Student Ambassador
http://www.dotnetjunkies.com/weblog/sriram
> > if you just concat two strings, you can safely use &.
> > If you concat more than two strings it is more performant to use
[quoted text clipped - 4 lines]
> Note that string literals will be concatenated by the compiler anyway,
> so "x" & "y" is exactly the same as "xy".
Jon Skeet [C# MVP] - 17 Jul 2004 18:35 GMT
> See Rico Mariani's post on the subject
> http://weblogs.asp.net/ricom/posts/40778.aspx
That post only talks about adding to an existing string. It doesn't say
anything about the case of
string x = y + z;
(or x = y & z in VB.NET) which is what I was talking about in my post.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too