Substring/Top and tail: Difference between revisions

Line 503:
: (pack (cddr (rot (chop "brooms")))) # Remove first and last characters
-> "room"</lang>
 
=={{header|PL/I}}==
<lang PL/I>
declare s character (100) varying;
s = 'now is the time to come to the aid of the party';
if length(s) <= 2 then stop;
put skip list ('First character removed=' || substr(s,2) );
put skip list ('Last character removed=' || substr(s, 1, length(s)-1) );
put skip list ('One character from each end removed=',
substr(s, 2, length(s)-2) );
</lang>
 
=={{header|Prolog}}==
Anonymous user