Method: ActiveSupport::Inflector#downcase_first
- Defined in:
- activesupport/lib/active_support/inflector/methods.rb
permalink #downcase_first(string) ⇒ Object
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('') # => ""
173 174 175 |
# File 'activesupport/lib/active_support/inflector/methods.rb', line 173 def downcase_first(string) string.length > 0 ? string[0].downcase.concat(string[1..-1]) : "" end |