I found an interesting thread on Channel 9 discussing String and StringBuilder. In short, when you use string method it creates a new string method. StringBuilder does not create a new object when the string is modified. Here’s a blog post with some good recommendations.
I can remember when we were rewriting our site in .Net last year. I was reviewing some code for a control that a consultant wrote and found some interesting stuff:
Dim sb As New StringBuilder
sb.Append(“<table width=””190″” border=””” & _MainBorder & “””>” & vbCrLf)
sb.Append(“<tr>” & vbCrLf)
sb.Append(“<td>” & vbCrLf)
My question is if you are using the StringBuilder to concatenate strings then why are you using the & operator? One of many questions I found in this code.