def break_up_long_line(str, max) counter = 0 new_text = '' for i in 0...str.length if str[i,1] =~ / / counter = 0 else counter = counter + 1 end new_text << str[i,1] if counter >= max && str[i,1] =~ /s/ new_text << " " counter = 0 end end new_text end
Rails breakup long lines
Leave a Reply
You must be logged in to post a comment.