Substring/Top and tail: Difference between revisions

Content added Content deleted
Line 511: Line 511:
put skip list ('First character removed=' || substr(s,2) );
put skip list ('First character removed=' || substr(s,2) );
put skip list ('Last character removed=' || substr(s, 1, length(s)-1) );
put skip list ('Last character removed=' || substr(s, 1, length(s)-1) );
put skip list ('One character from each end removed=',
put skip list ('One character from each end removed=' ||
substr(s, 2, length(s)-2) );
substr(s, 2, length(s)-2) );
</lang>
</lang>
OUTPUT:
<pre>
First character removed=ow is the time to come to the aid of the party
Last character removed=now is the time to come to the aid of the part
One character from each end removed=ow is the time to come to the aid of the part
</pre>


=={{header|Prolog}}==
=={{header|Prolog}}==