Tips for fast string concatenation?

Gary Willoughby dev at kalekold.net
Fri Jun 21 03:09:09 PDT 2013


Have you any tips for using D when you need fast string 
concatenation? I regularly use code like this:

     foreach (i, range)
     {
         foo ~= bar;
     }

or:

     foo = foo ~ bar ~ baz ~ qux;

I've used std.string.format(...) in some instances which sped 
things up which surprised me.

Are there faster ways of appending strings?


More information about the Digitalmars-d-learn mailing list