Skip to content

Instantly share code, notes, and snippets.

@elim
Forked from dzfl/strimwidth.rb
Created July 24, 2008 06:48
Show Gist options
  • Save elim/2070 to your computer and use it in GitHub Desktop.
Save elim/2070 to your computer and use it in GitHub Desktop.
strimwidth
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