StringBuilder vs. String / Fast String Operations with .NET 2.0

对字符操作 比较 介绍比较详细的文章。
http://www.codeproject.com/KB/cs/StringBuilder_vs_String.aspx
String.Insert vs StringBuilder


String.Replace

String.Format

String Concatenation

String Comparison

String Operation

Most Efficient

Insert

StringBuilder.Insert > 2 Insertion Strings
String.Insert otherwise

Remove

StringBuilder is faster > 2 characters
to remove

Replace

String.Replace always

Format

String.Format < 5 Append + Format operations
StringBuilder.AppendFormat > 5 calls

Concatenation

+ for 2 strings
String.Join > 2 strings to concatenate








原文地址:https://www.cnblogs.com/try/p/460794.html