Re: String Concatenation in VB.NET
From: Michael Pearson (michaelp_extrajunktoremove_at_televox.com)
Date: 06/29/04
- Next message: Henning Krause: "Re: String Concatenation in VB.NET"
- Previous message: AlexS: "Re: String Concatenation in VB.NET"
- In reply to: AlexS: "Re: String Concatenation in VB.NET"
- Next in thread: Henning Krause: "Re: String Concatenation in VB.NET"
- Reply: Henning Krause: "Re: String Concatenation in VB.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 29 Jun 2004 18:04:41 -0500
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
"AlexS" <salexru2000NO@SPAMsympaticoPLEASE.ca> wrote in message
news:O4OCBjiXEHA.3988@tk2msftngp13.phx.gbl...
> Hi, YGeek
>
> Both are same in terms of memory and processor use. And both are
> sub-efficient. It is not recommended to use concatenation in loops and
> frequently.
> The fastest and most efficient way to combine strings is with
StringBuilder.
>
> HTH
> Alex
>
> "YGeek" <YGeek@discussions.microsoft.com> wrote in message
> news:0CDC04AB-AC06-4D24-B04D-E42EE5384C02@microsoft.com...
> > Is there a performance issue with using & to do string concatenation
> versus using the String.Concat method? What is the best practice for
doing
> string concatenation in VB.NET?
>
>
- Next message: Henning Krause: "Re: String Concatenation in VB.NET"
- Previous message: AlexS: "Re: String Concatenation in VB.NET"
- In reply to: AlexS: "Re: String Concatenation in VB.NET"
- Next in thread: Henning Krause: "Re: String Concatenation in VB.NET"
- Reply: Henning Krause: "Re: String Concatenation in VB.NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|