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