ucfirst

Perl's ucfirst() function takes a string, makes the first character uppercase, and then returns the new string.

 $myName = 'andrew';
 $myUpperName = ucfirst($myName); 

First, $myName is set to a value of 'andrew', then the ucfirst() function is run on $myName. The ucfirst() function takes the first character of $myName (in this case 'a') and converts it to it's uppercase equivalent. The value of $myUpperName is then equal to 'Andrew'.

posted @ 2013-04-09 14:14  鍒樻爧  阅读(260)  评论(0编辑  收藏  举报