PDA

View Full Version : When exactly should a StringBuilder be used?



gicio
11-10-2003, 06:03 AM
Hi!

I’m very interesting in when to use exactly the StringBuilder?

For example for something like this?:

String strTest1 = “This”;
String strTest2 = “Test”;
StringBuilder stbTest = new StringBuilder();
stbTest.Append(strTest1). Append(“is a ”). Append(stbTest);


can someone provide some sample codes when to use a StringBuilder?

And can someone tell me his experience about the performance of a StringBuilder?


Regards,


gicio

Osiris
11-10-2003, 02:14 PM
Maybe if you could give us a bit more detail on what this "StringBuilder" is... my intuition would say all that code above is doing is appended some strings together rather elaborately and pointlessly.