doc: Update cs.md #106

This commit is contained in:
jaywcjlove 2022-11-17 13:04:15 +08:00
parent 1d1f8778dd
commit effa2500ed

View File

@ -188,16 +188,17 @@ lengthOfString.Contains("How"); // => true
### 频繁字符串拼接
```cs
// 对于频繁拼接字符串的场景(如:成百上千次循环)
// 使用 System.Text.StringBuilder 提升性能
var sb = new StringBuilder();
for (int i = 0; i < 100; i++)
{
sb.Append(i.ToString());
}
Console.WriteLine(sb.ToString()); // => 123456789....
Console.WriteLine(sb.ToString());
// => 123456789....
```
对于频繁拼接字符串的场景(如:成百上千次循环),使用 `System.Text.StringBuilder` 提升性能
<!--rehype:className=wrap-text-->
### 原始字符串文本