One thought on “Using .Net Programming what is the best string concatenation method?”
Hello Mario
The answer to your question depends on the string. If the concatenations are less than 1000, String.Join() is the most efficient. However for all other cases StringBuilder.Append() is the most efficient. The following code is an example of how to append using StringBuilder.
StringBuilder strtemp = new StringBuilder();
strtemp.Append(someNewString);
Hello Mario
The answer to your question depends on the string. If the concatenations are less than 1000,
String.Join()
is the most efficient. However for all other casesStringBuilder.Append()
is the most efficient. The following code is an example of how to append using StringBuilder.StringBuilder strtemp = new StringBuilder();
strtemp.Append(someNewString);