Ruby on Rails uncapitalize first letter

前端 未结 10 1456
感动是毒
感动是毒 2021-02-03 19:48

I\'m running Rails 2.3.2.

How do I convert \"Cool\" to \"cool\"? I know \"Cool\".downcase works, but is there a Ruby/Rails method

10条回答
  •  时光说笑
    2021-02-03 20:20

    If you use Ruby Facets, you can lowercase the first letter:

    https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/uppercase.rb

提交回复
热议问题