Skip to content

Instantly share code, notes, and snippets.

@dzfl
Created July 23, 2008 19:39
Show Gist options
  • Save dzfl/1872 to your computer and use it in GitHub Desktop.
Save dzfl/1872 to your computer and use it in GitHub Desktop.
class String
def strimwidth(width)
self.split(//)[0...width].join
end
end
#see also http://www.ruby-lang.org/ja/man/html/Array.html#self.5bstart.2e.2eend.5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment