Method: String#capitalize_first
- Defined in:
- lib/jinx/helpers/inflector.rb
#capitalize_first ⇒ String
Returns this String with the first letter capitalized and other letters preserved.
17 18 19 |
# File 'lib/jinx/helpers/inflector.rb', line 17 def capitalize_first sub(/(?:^)(.)/) { $1.upcase } end |