The reason to avoid string concatenation operator is this: strings are immutable.
Another reason is the code is less readable is used like in the Question.
So, the problem with immutable strings is this. What happens here:
string result = string.Empty;
int count = 100;
for (int index = 0; index < count; index++)
result += CalculateNext(index);
The problem here is at every plus string is not appended. Instead, new object is created and old string value (ever increasing) will be copied and assigned to the same variable
result
.
This is slow, so
System.Text.StringBuilder
should be used instead. If used sparingly for ad-hoc purposes like in the present Question, concatenation is not a problem, but for readability
string.Format
is the best; it also has better performance.
—SA