Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
samwhiteUK
· 4y ago · 0 comments
When I want to use negative indices, I pipe the string through rev first, then do my cut, then rev again
Comments
[–]
mprovost
4y ago
That's the classic solution but blows up when using multibyte characters since rev just reads the bytes in each line in reverse.