The size of the string buffer is doubled when it needs to be increased. So even if it has to be copied every time it is resized, that averages out to the equivalent of just one extra copying of the final string. So it isn't a big penalty.
Update: What is true of arrays need not be true of strings, it appears. Thanks, ikegami.
- tye
In reply to Re^3: Is there something faster than string concatenation? (hermit crabs)
by tye
in thread Is there something faster than string concatenation?
by rdj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |