From: Sebastian Hungerecker Date: 2008-09-20T18:07:09+09:00 Subject: Re: [QUIZ] One-Liners Mashup (#177 again) James Gray wrote: > New puzzle:  Provide a one-liner that can wrap a body of text at a   > requested maximum length. Wasn't that a question in the old one liner quiz? Anyway (without looking it up): text.gsub(/.{1,80}/,"\\0\n") Or if you want to avoid breaking in the middle of words: text.gsub(/(.{1,80})\s+/, "\\1\n") (you'll have lines above 80 chars if there's a single word with more than 80 characters). Next question: Sort an array of words by the words' values where a word's value is the sum of the values of its letters and a letter's value is its position in the alphabet. So the value of "Hello" is 8+5+12+12+15. -- Jabber: sepp2k@jabber.org ICQ: 205544826