[Newbies] appending Strings
Mariano Abel Coca
marianoabelcoca at gmail.com
Fri Oct 3 20:09:39 UTC 2008
Just check it by yourself. ;)
[ result := String new.
4000 timesRepeat: [ result := result, 'abcdefg' ]].
[ writer := WriteStream on: String new.
4000 timesRepeat: [ writer nextPutAll:'abcdefg' ]].
On Fri, Oct 3, 2008 at 2:02 PM, Herbert König <herbertkoenig at gmx.net> wrote:
> Hello Mark,
> Friday, October 3, 2008, 4:52:39 PM, you wrote:
> MV> Is there a reason to prefer one of these approaches over the other?
> MV> Maybe one is more efficient and should be preferred if doing a large
> MV> number of appends.
> speed is the reason for the stream approach. The #, approach copies
> the first string once for each #, send.
> MV> Are there other approaches I should consider?
> Don't know of any but then I'm not an expert.
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners