Exists in Delphi something like the Java or C# StringBuilder? Or Delphi does not need StringBuilder and s := s + \'some string\';
is good expression (mainly in for,
I'm really surprised that no one mentioned in any of the comments or examples that you can instruct TStringBuilder to preallocate a buffer appropriate to the task during instantiation. In other words, if you can come up with a simple estimate of how much memory you'll probably need, pad that a bit, and use that value to instantiate TStringBuilder , you avoid the memory reallocations that slow simple string concatenation to a crawl:
buff := TStringBuilder.Create( tmpEstimatedSize );
I use TStringBuilder regularly in new code and to optimize old code, and the CPU savings when building large strings incrementally is dramatic. Now to be transparent, if I just have a handful of strings to concatenate, I don't bother with TStringBuilder. But if I'm, say, serializing what could potentially be a large amount of data, TStringBuilder is the obvious solution.