Skip to content

Instantly share code, notes, and snippets.

@newstler
Created December 30, 2010 18:45
Show Gist options
  • Save newstler/760109 to your computer and use it in GitHub Desktop.
Save newstler/760109 to your computer and use it in GitHub Desktop.
Expanding string class to work with Unicode. You'll also need gem 'unicode'.
String.class_eval do
def downcase
Unicode::downcase(self)
end
def downcase!
self.replace downcase
end
def upcase
Unicode::upcase(self)
end
def upcase!
self.replace upcase
end
def capitalize
Unicode::capitalize(self)
end
def capitalize!
self.replace capitalize
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment