instance method downcase_first

Ruby on Rails 8.0.4

Since v7.1.6

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

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

string req
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close