(c) Defining methods [2]
giveMe: aString repeated: numTimes
“Repeats a string multiple times”
| tempString |
tempString := ‘’.
numTimes timesRepeat: [
tempString := tempString , aString ].
^ tempString
Previous slide
Next slide
Back to first slide
View graphic version