Created
December 30, 2010 18:45
-
-
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'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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