From: Chad Perrin Date: 2007-04-27T19:22:05+09:00 Subject: Re: using Ruby for line-wrapping On Fri, Apr 27, 2007 at 06:50:06PM +0900, William James wrote: > > X = 40 > puts str.gsub(/\n/," ").scan(/\S.{0,#{X-2}}\S(?=\s|$)|\S+/) Thanks. The scan method's pretty nice. I had no idea it existed. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] Larry Wall: "A script is what you give the actors. A program is what you give the audience."