4 ms·
When I want to use negative indices, I pipe the string through rev first, then do my cut, then rev again
by samwhiteUK 4y ago
When I want to use negative indices, I pipe the string through rev first, then do my cut, then rev again
- mprovost 4y agoThat's the classic solution but blows up when using multibyte characters since rev just reads the bytes in each line in reverse.