instance method
downcase_first
Ruby on Rails 8.1.2
Since v7.1.6Signature
downcase_first(string)
Converts the first character in the string to lowercase.
downcase_first('If they enjoyed The Matrix') # => "if they enjoyed The Matrix" downcase_first('I') # => "i" downcase_first('') # => ""
Parameters
-
stringreq
Source
# File activesupport/lib/active_support/inflector/methods.rb, line 175
def downcase_first(string)
string.length > 0 ? string[0].downcase.concat(string[1..-1]) : +""
end
Defined in activesupport/lib/active_support/inflector/methods.rb line 175
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Inflector