Jump to content

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>
 
559

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.