News for hackers. Stuff that matters.
Re:Show HN: Tuc – When cut doesn’t cut it by samwhiteUK on Monday June 13, 2022 @12:27PM (#31727738)
When I want to use negative indices, I pipe the string through rev first, then do my cut, then rev again
Re:Show HN: Tuc – When cut doesn’t cut it by mprovost on Monday June 13, 2022 @01:54PM (#31728981)
That's the classic solution but blows up when using multibyte characters since rev just reads the bytes in each line in reverse.