Flowdock
method

limit

Importance_1
v3.0.0 - Show latest stable - 0 notes - Class: ActiveSupport::Multibyte::Chars
limit(limit) public

Limit the byte size of the string to a number of bytes without breaking characters. Usable when the storage for a string is limited for some reason.

Example:

  s = 'こんにちは'
  s.mb_chars.limit(7) # => "こに"
Show source
Register or log in to add new notes.