When do you use StringBuilder.AppendLine/string.Format vs. StringBuilder.AppendFormat?

I view AppendFormat followed by AppendLine as not only more readable, but also more performant than calling AppendLine(string.Format(...)).

The latter creates a whole new string and then appends it wholesale into the existing builder. I’m not going to go as far as saying “Why bother using StringBuilder then?” but it does seem a bit against the spirit of StringBuilder.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)