Substring/Top and tail: Difference between revisions
Content added Content deleted
(Better D entry) |
|||
Line 630: | Line 630: | ||
puts "socks".chop # alternate way to strip last character |
puts "socks".chop # alternate way to strip last character |
||
puts "brooms"[1..-2] # strip both first and last characters</lang> |
puts "brooms"[1..-2] # strip both first and last characters</lang> |
||
=={{header|Run BASIC}}== |
|||
<lang runbasic>s$ = "Run BASIC" |
|||
print mid$(s$,2) 'strip first |
|||
print left$(s$,len(s$) -1) 'strip last |
|||
print mid$(s$,2,len(s$) -2) 'strip first and last</lang> |
|||
=={{header|Scala}}== |
=={{header|Scala}}== |