ruby首字母大写

Modifies str by converting the first character to uppercase and the remainder to lowercase. Returns nil if no changes are made. Note: case conversion is effective only in ASCII region.

   a = "hello"
   a.capitalize!   #=> "Hello"
   a               #=> "Hello"
   a.capitalize!   #=> nil

原文地址:https://www.cnblogs.com/lexus/p/1951627.html