Anonymous user
Substring/Top and tail: Difference between revisions
Added PicoLisp
m (J: simplify (function composition is unnecessary for this task)) |
(Added PicoLisp) |
||
Line 43:
echo substr("brooms", 1, -1), "\n"; // strip both first and last characters
?></lang>
=={{header|PicoLisp}}==
<lang PicoLisp>: (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"</lang>
=={{header|PureBasic}}==
|