String Benchmarks in C# - Refactoring for Speed/Maintainability

后端 未结 10 1411
无人及你
无人及你 2021-02-09 21:29

I\'ve been tinkering with small functions on my own time, trying to find ways to refactor them (I recently read Martin Fowler\'s book Refactoring: Improving the Design of Ex

10条回答
  •  终归单人心
    2021-02-09 21:45

    Use a StringBuilder instead of concatenation. Each concatenation is creating a new string instance and throwing away the old.

提交回复
热议问题