RosettaCodeData/Task/Substring-Top-and-tail/Smalltalk/substring-top-and-tail.st

6 lines
267 B
Smalltalk
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
s := 'upraisers'.
Transcript show: 'Top: ', s allButLast; nl.
Transcript show: 'Tail: ', s allButFirst; nl.
Transcript show: 'Without both: ', s allButFirst allButLast; nl.
Transcript show: 'Without both using substring method: ', (s copyFrom: 2 to: s size - 1); nl.