Possible Duplicate:
When to use StringBuilder?
I am working hard in performance gaining in the Enterprise project. Our solution architect suggesting to convert all string declarions in to stringbuilder If even one append is there to that string variable. for ex: str += str2;
I know, if we are modiying string many times (ex: many appends) can be time consuming to create new string objects. we should go to stringbuilder.
Now Question is –
Creating string builder object (without specifying default size) Vs one time append in to string variablein respect of performance improvement.
There are a number of articles out there that answer this question for you. Here is the first one I came across:
http://www.codeproject.com/Articles/6771/String-Vs-StringBuilder-C
Basically, the answer is that no, you probably shouldn’t use stringbuilder for instances where you only append text once or twice. It is really for when you are doing so repeatedly.