Substring/Top and tail: Difference between revisions
add sed
Jazzedpineda (talk | contribs) (Add Microsoft Small Basic, EasyLang, Golfscript) |
(add sed) |
||
Line 2,168:
(define (string-top-tail s)
(string-tail (string-top s)))</syntaxhighlight>
=={{header|sed}}==
Remove the first character:
<syntaxhighlight lang="sed">s/.//</syntaxhighlight>
Remove the last character:
<syntaxhighlight lang="sed">s/.$//</syntaxhighlight>
Remove the first and the last character in one step:
<syntaxhighlight lang="sed">s/.\(\(.*\).\)\{0,1\}/\2/</syntaxhighlight>
=={{header|Seed7}}==
|