好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

ruby首字母大写

ruby首字母大写

str.capitalize! → str or nil

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

查看更多关于ruby首字母大写的详细内容...

  阅读:44次