Replace string cat with StringBuilder in tight for loop with potential for many iterations.