From: 7stud -- Date: 2009-09-13T03:47:40+09:00 Subject: Re: Word Wrapping at n characters Marc Heiler wrote: > Right now I basically use this code for word wrapping: > > def word_wrap(line_width = 80) > self.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n") > end > > Is anyone using a better solution? This method should be > robust enough to do "proper" line wrapping of really > long strings - like strings long enough to fill > a big book. str =<