[Newbies] appending Strings

Mark Volkmann mark at ociweb.com
Fri Oct 3 14:52:39 UTC 2008


Is there a reason to prefer one of these approaches over the other?
Maybe one is more efficient and should be preferred if doing a large  
number of appends.

Approach #1

s := ''.
s := s, 'foo'.
s := s, 'bar'

Approach #2

stream := WriteStream on: ''.
stream nextPutAll: 'foo'.
stream nextPutAll: 'bar'.
s := stream contents

Are there other approaches I should consider?

---
Mark Volkmann






More information about the Beginners mailing list