Below are two ways how to append String
:
String firstString = "text_0";
String secondString = "text_1";
String resultString = firstString + secondString;
StringBuilder sb = new StringBuilder();
sb.append(firstString).append(secondString);
String resultString = sb.toString();
My question is - when is more effective to use StringBuilder
? Let's say there are 10 strings, and I need to create one of them.