CS.LOOP.STR.CONCAT
Using string concatenation in a loop wastes time and memory. Use StringBuilder instead.
Example 1
Copy
class Foo {
public string Build(int n, string x) {
string res = "";
for (int i = 0; i < n; i++) {
res += x; // defect
}
return res;
}
}