The StringBuilder.Append()
method is much better than using the + operator. But I've found that, when the concatenations are less than 1000, String.Join()
is even more efficient than StringBuilder
.
StringBuilder sb =newStringBuilder();
sb.Append(someString);
The only problem with String.Join
is that you have to concatenate the strings with a common delimiter.
string key =String.Join("_",newString[]{"Customers_Contacts", customerID, database,SessionID});