Fastest way to append char to string?

monarch_dodra monarchdodra at gmail.com
Tue Dec 11 08:00:25 PST 2012


On Tuesday, 11 December 2012 at 15:52:31 UTC, Chopin wrote:
> Is this the fastest way to append a char to string?
>
> char c = 'a';
> string s;
> s ~= c;
>
> ?
>
> I have a program that does this many many times... and it's 
> slow. So I was wondering it it could be it.
>
> Thanks for tips!

This may or may not be the fastest way.

This should give you a good idea of what's going on:
http://dlang.org/d-array-article.html


More information about the Digitalmars-d-learn mailing list