Perl

  1. Home
  2. Computing & Technology
  3. Perl

Perl string ucfirst() function - Quick Tutorial

How to use the string ucfirst() function

From About.com

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'.
More Perl Quick Tips

Explore Perl

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Perl

  1. Home
  2. Computing & Technology
  3. Perl
  4. Programming Perl
  5. Perl ucfirst function reference - learn how to use Perl's ucfirst() function in this quick tutorial.

©2009 About.com, a part of The New York Times Company.

All rights reserved.