------art_3280_24065127.1221919835773
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

>
> New puzzle:  Provide a one-liner that can wrap a body of text at a
> requested maximum length.



A first guess... this destroys all original whitespace in the string,
currently trying to fix that.

class String
  def line_wrap(n  0)
    split(/\s+/).inject{ |s,w| s + ("#{s.split("\n").last} #{w}".size > n ?
"\n" : " ") + w }
  end
end

------art_3280_24065127.1221919835773--