Flowdock
method

slice!

Importance_1
v2.3.2 - Show latest stable - 0 notes - Class: ActiveSupport::Multibyte::Chars
slice!(*args) public

Like String#slice!, except instead of byte offsets you specify character offsets.

Example:

  s = 'こんにちは'
  s.mb_chars.slice!(2..3).to_s #=> "にち"
  s #=> "こんは"
Show source
Register or log in to add new notes.