Substring/Top and tail: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 90: | Line 90: | ||
print substr(mystring,2,length(mystring)-2) # remove both the first and last character |
print substr(mystring,2,length(mystring)-2) # remove both the first and last character |
||
}</lang> |
}</lang> |
||
=={{header|BASIC}}== |
|||
<lang basic>10 PRINT FN F$("KNIGHTS"): REM STRIP THE FIRST LETTER |
|||
20 PRINT FN L$("SOCKS"): REM STRIP THE LAST LETTER |
|||
30 PRINT FN B$("BROOMS"): REM STRIP BOTH THE FIRST AND LAST LETTER |
|||
100 END |
|||
9000 DEF FN F$(A$)=RIGHT$(A$,LEN(A$)-1) |
|||
9010 DEF FN L$(A$)=LEFT$(A$,LEN(A$)-1) |
|||
9020 DEF FN B$(A$)=FN L$(FN F$(A$))</lang> |
|||
=={{header|Bracmat}}== |
=={{header|Bracmat}}== |