CS.LOOP.STR.CONCAT

Using string concatenation in a loop wastes time and memory. Use StringBuilder instead.

Example 1

1  class Foo {
2      public string Build(int n, string x) {
3          string res = "";
4          for (int i = 0; i < n; i++) {
5              res += x;       // defect
6          }
7          return res;
8      }
9  }