Substring/Top and tail: Difference between revisions
Content added Content deleted
({{header|Perl}}) |
(→{{header|Perl}}: Added PureBasic) |
||
Line 32: | Line 32: | ||
[[Category:String manipulation]] |
[[Category:String manipulation]] |
||
=={{header|PureBasic}}== |
|||
<lang PureBasic>If OpenConsole() |
|||
PrintN(Right("knight", Len("knight") - 1)) ;strip the first letter |
|||
PrintN(Left("socks", Len("socks")- 1)) ;strip the last letter |
|||
PrintN(Mid("brooms", 2, Len("brooms") - 2)) ;strip both the first and last letter |
|||
Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() |
|||
CloseConsole() |
|||
EndIf</lang> |
|||
Sample output: |
|||
<pre>night |
|||
sock |
|||
room</pre> |