instance method downcase_first

Ruby on Rails edge

Since v7.1.6

Available in: v7.1.6 v7.2.4 v8.0.5.1 v8.1.4 edge

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 196
    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 196 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Inflector

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close