Method: String#wrap!
- Defined in:
- lib/extra/string.rb
#wrap!(width = 80, separator = $/) ⇒ Object
Destructive version of String#wrap.
Returns: String or nil
213 214 215 216 |
# File 'lib/extra/string.rb', line 213 def wrap!(width = 80, separator = $/) wrapped = wrap(width, separator) self[0..-1] = wrapped unless wrapped == self end |