string and string builder code example
Example 1: string vs stringbuilder
String is immutable and thread safe
String builder mutable and not thread safe
Example 2: why string builder
StringBuilder is for, well, building strings.
Specifically, building them in a very
performance way. The String class is good
for a lot of things, but it actually has
really terrible performance when assembling
a new string out of smaller string parts
because each new string is a totally new,
reallocated string.