A StringBuilder will help you when you need to build strings in multiple steps.
Instead of doing this:
String x = ""; x += "first "; x += "second "; x += "third ";
you do :-
StringBuilder sb = new StringBuilder(""); sb.Append("first "); sb.Append("second "); sb.Append("third"); String x = sb.ToString();
the final effect is the same, but the StringBuilder will use less memory and will run faster. Instead of creating a new string which is the concatenation of the two, it will create the chunks separately, and only at the end it will unite them.
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!