in reply to Re: Concatenate or Join?
in thread Concatenate or Join?

Thanks Dave for the input. I was comparing a situation where I can either fill an array as I parse through data and then later join, or just concatenate as I go.

I agree that if the array is already created then it is certainly faster to join. But if you have to build the array just so you can join the elements later, it looks like concatenation is faster. Or am I missing something?

Replies are listed 'Best First'.
Re^3: Concatenate or Join?
by dave_the_m (Monsignor) on Nov 13, 2012 at 09:11 UTC
    In that case, doing the concat (and thus skipping creating the array) could be faster, but would probably depend on such factors as the pattern of string lengths, and whether you could presize the string.

    Dave.