class String

Public Instance Methods

wrap(wrap_length=80, char="\n") click to toggle source

Wrap string by the given length, and join it with the given character. The method doesn't distinguish between words, it will only work based on the length.

# File lib/rhc/core_ext.rb, line 37
def wrap(wrap_length=80, char="\n")
  scan(%r.{#{wrap_length}}|.+/).join(char)
end