Substring/Top and tail: Difference between revisions

Line 13:
<lang algol68>#!/usr/local/bin/a68g --script #
 
STRING str="carousersupraisers";
printf(($gl$,
str, # remove no characters #
Line 21:
str[LWB str+2: ], # remove the first 2 characters #
str[ :UPB str-2], # remove the last 2 characters #
str[LWB str+1:UPB str-2], # remove 1 before and 2 after #
str[LWB str+2:UPB str-1], # remove 2 before and one after #
str[LWB str+2:UPB str-2] # remove both the first and last 2 characters #
))</lang>
Output:
<pre>
upraisers
carousers
praisers
arousers
upraiser
carouser
praiser
arouser
raisers
rousers
upraise
carouse
praise
rouse
raiser
raise
</pre>