I\'m fairly new to Ruby and I\'ve been searching Google for a few hours now. Does anyone know how to format the output of a print to be no more than 40 characters long?
puts x.join(" ").scan(/(.{1,40})(?:\s|$)/m)
This is a simple sentence. This simple sentence appears on three lines.