Subject: | Consider adding a column-aware substr()-like replacement |
I'd find it quite useful to have a substr-like function that counted
screen columns instead of bytes/chars.
If you consider the difference between
length $str vs mbswidth $str
as counting in bytes/characters or screen columns, then it would suggest
such a function as
substr $str, $start, $len vs mbswsubstr $str, $start, $width
to take a substring starting at the $start'th column and proceeding for
the next $width columns.
I'd be quite happy to have a go at implementing this - how would you
like a patch?
--
Paul Evans