对字符操作 比较 介绍比较详细的文章。
http://www.codeproject.com/KB/cs/StringBuilder_vs_String.aspx
String Operation |
---|
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