You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Concatenation is fine for simple cases but we've all had it drilled into us that StringBuilder is the way to go for successively building up large strings, particularly in loops, to avoid creating lots of very large garbage. The problem is that you have to completely change your code to go from one to the other. But, if we extend & to support StringBuilder on the left then most of the code could stay the same using &= and only the declaration of the variable would need to change to reap performance improvements.
In short, StringBuilder & <value> would be defined to be StringBuilder.Append(<value>) and StringBuilder &= <value> would be defined as StringBuilder = StringBuilder.Append(<value>).
reduckted, gilfusion, rskar-git, Nukepayload2 and franzalex