Hacker News new | ask | show | jobs
by samwhiteUK 1469 days ago
When I want to use negative indices, I pipe the string through rev first, then do my cut, then rev again
1 comments

That's the classic solution but blows up when using multibyte characters since rev just reads the bytes in each line in reverse.