Substring/Top and tail: Difference between revisions
sed: add hint
(add sed) |
(sed: add hint) |
||
Line 2,174:
Remove the last character:
<syntaxhighlight lang="sed">s/.$//</syntaxhighlight>
Remove the first and the last character in one step (a bit more complex, to correctly handle single-character strings):
<syntaxhighlight lang="sed">s/.\(\(.*\).\)\{0,1\}/\2/</syntaxhighlight>
|