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

9 lines
234 B
Plaintext

: (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"