I am displaying a string of certain length in ruby. only 80 characters of that string can be displayed in one line. for example if string length is 82 then it will be shown
Just out of curiosity:
loop.inject([[], input]) do |(acc, src)| if m = src[/.{1,79}(\s|\z)/] [acc << m, $'] else break acc << src end end