Skip to content

Instantly share code, notes, and snippets.

@dentarg
Created June 14, 2012 16:22
Show Gist options
  • Select an option

  • Save dentarg/2931277 to your computer and use it in GitHub Desktop.

Select an option

Save dentarg/2931277 to your computer and use it in GitHub Desktop.
class String
alias_method :real_downcase, :downcase
alias_method :real_upcase, :upcase
alias_method :real_capitalize, :capitalize
def downcase
self.real_downcase.tr('ÅÄÖ', 'åäö')
end
def upcase
self.real_upcase.tr('åäö', 'ÅÄÖ')
end
def capitalize
s = self.real_capitalize
s[0] = s[0].upcase
s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment