RosettaCodeData/Task/Substring-Top-and-tail/Arturo/substring-top-and-tail.arturo
2026-02-01 16:33:20 -08:00

13 lines
597 B
Text

knight: "knight"
socks: "socks"
brooms: "brooms"
print drop knight ; strip first character
print slice knight 1 (size knight)-1 ; alternate way to strip first character
print chop socks ; strip last character
print take socks (size socks)-1 ; alternate way to strip last character
print slice socks 0 (size socks)-2 ; yet another way to strip last character
print chop drop brooms ; strip both first and last characters
print slice brooms 1 (size brooms)-2 ; alternate way to strip both first and last characters