module ActiveSupport::Inflector
def upcase_first(string)
upcase_first('w') # => "W"
upcase_first('what a Lovely Day') # => "What a Lovely Day"
Converts the first character in the string to uppercase.
def upcase_first(string) string.length > 0 ? string[0].upcase.concat(string[1..-1]) : +"" end