Repeat a string: Difference between revisions

(Two variants)
Line 1,082:
By creating a WriteStream, and putting 5 times the string 'ha' into it:
 
<lang smalltalk>ws := '' writeStream.
ws := '' writeStream.
5 timesRepeat: [ws nextPutAll: 'ha'].
ws contents.</lang>
</lang>
 
Evaluates to:
Anonymous user