RosettaCodeData/Task/Substring-Top-and-tail/Arturo/substring-top-and-tail.arturo
2023-09-01 09:35:06 -07: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