RosettaCodeData/Task/Substring-Top-and-tail/PicoLisp/substring-top-and-tail.l

9 lines
234 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
: (pack (cdr (chop "knight"))) # Remove first character
-> "night"
: (pack (head -1 (chop "socks"))) # Remove last character
-> "sock"
: (pack (cddr (rot (chop "brooms")))) # Remove first and last characters
-> "room"