diff options
Diffstat (limited to 'activesupport/lib')
| -rw-r--r-- | activesupport/lib/active_support/multibyte/chars.rb | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 3c0cf9f137..4154af8428 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -88,6 +88,12 @@ module ActiveSupport #:nodoc:        # Works like like <tt>String#slice!</tt>, but returns an instance of        # Chars, or nil if the string was not modified. +      # +      #   string = 'Welcome' +      #   string.mb_chars.slice!(3)    # => #<ActiveSupport::Multibyte::Chars:0x000000038109b8 @wrapped_string="c"> +      #   string # => 'Welome' +      #   string.mb_chars.slice!(0..3) # => #<ActiveSupport::Multibyte::Chars:0x00000002eb80a0 @wrapped_string="Welo"> +      #   string # => 'me'        def slice!(*args)          chars(@wrapped_string.slice!(*args))        end | 
