Skip to content

Instantly share code, notes, and snippets.

@flazz
Created January 30, 2009 22:58
Show Gist options
  • Save flazz/55333 to your computer and use it in GitHub Desktop.
Save flazz/55333 to your computer and use it in GitHub Desktop.
class String
def wrap(width)
if length > width
self[0...width] + '\n' + self[width..-1].wrap(width)
else
self
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment