Class: String

Inherits:
Object show all
Defined in:
lib/array_pair.rb

Instance Method Summary collapse

Instance Method Details

#wrap(col = 80) ⇒ Object



12
13
14
15
# File 'lib/array_pair.rb', line 12

def wrap(col=80)
  gsub(/(.{1,#{col}})( +|$\n?)|(.{1,#{col}})/,
    "\\1\\3\n") 
end