nobu.nokada
7/9/2005 3:41:00 AM
Hi,
At Sat, 9 Jul 2005 12:25:50 +0900,
daz wrote in [ruby-talk:147632]:
> s = 'abcdefghijklmnopqrstuvwxyz'
> puts s[0, 6] << '...'
>
> #-> abcdef...
If you consider multi-byte environments, you should strip
trailing garbage bytes.
puts s[0, 6][/\A.*/m] << '...'
--
Nobu Nakada