Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/multibytes.rb
Overview
Handling of multi-byte characters (or Japanese).
Assume that $KCONV has been set appropriately
Instance Method Summary collapse
-
#jleft_w_dots(len) ⇒ Object
see www.ruby-lang.org/ja/man/ chapter 10 (method jleft).
Instance Method Details
#jleft_w_dots(len) ⇒ Object
see www.ruby-lang.org/ja/man/ chapter 10 (method jleft)
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/multibytes.rb', line 8 def jleft_w_dots(len) len0 = self.length if len0 <= len self.dup else str = self[0,len] str[-1,1] = '' if /.\z/ !~ str str[-1,1] = '' if /.\z/ !~ str # don't know why, but needed two times str + '..' end end |