E
Erik Terpstra
In case anyone needs it,
str = 'This is a test of the emergency broadcasting services'
str.scan(/(.{1,30})(?:\s+|$)/)
=> [["This is a test of the"], ["emergency broadcasting"], ["services"]]
str = 'This is a test of the emergency broadcasting services'
str.scan(/(.{1,30})(?:\s+|$)/)
=> [["This is a test of the"], ["emergency broadcasting"], ["services"]]