Anonymous user
Substring/Top and tail: Difference between revisions
m
→[[Remove_the_first_and_last_characters_from_a_string/Top_and_tail#ALGOL 68]]: use alternate word: carousers
m (→[[Remove_the_first_and_last_characters_from_a_string/Top_and_tail#ALGOL 68]]: use alternate word: carousers) |
|||
Line 13:
<lang algol68>#!/usr/local/bin/a68g --script #
STRING
printf(($gl$,
str[LWB str+1:UPB str-1], # remove both the first and last character #
str[LWB str+2: ], # remove the first 2 characters #
str[ :UPB str-2], # remove the last 2 characters #
str[LWB str+2:UPB str-2] # remove both the first and last 2 characters #
))</lang>
Output:
<pre>
carousers
arousers
carouser
arouser
rousers
carouse
rouse
</pre>
=={{header|AWK}}==
|