Lou Vanek wrote:
> here's a (partially modded) excerpt from a previous discussion on this 
> topic:
> 
> width = 11
> str = 'This is a  test of the emergency broadcasting servicings I 
> asseverate'
> p str.scan(/\S.{0,#{width}}\S(?=\s|$)|\S+/)

When I was writing that I just KNEW there must be some one-line solution 
involving regular expressions!

Although I don't quite follow the exact structure of this one, it 
definitely works...

Jeff

-- 
Posted via http://www.ruby-forum.com/.