def wrap_text(txt, col = 80)
txt.gsub(/(.{1,#{col}})( +|$)
?|(.{#{col}})/,
"13
")
end
Text Wrapping with Regular Expressions
Leave a Reply
You must be logged in to post a comment.
def wrap_text(txt, col = 80)
txt.gsub(/(.{1,#{col}})( +|$)
?|(.{#{col}})/,
"13
")
end
You must be logged in to post a comment.