Replaces string concatenation operations with method calls on a local StringBuilder instance, to improve performance (working with a StringBuilder is faster than concatenating strings).
- when the selection contains several assignment statements that are used to construct a string (each statement appends a string to the previously accumulated value).
string result = s1; result += s2; result += s3;
Dim result As String = s1 result += s2 result += s3
StringBuilder resultBuilder = new StringBuilder(s1); resultBuilder.Append(s2); resultBuilder.Append(s3);
Dim lResultBuilder As StringBuilder = New StringBuilder(s1) lResultBuilder.Append(s2) lResultBuilder.Append(s3)