1. Home
  2. Computing & Technology
  3. Perl

Perl string lcfirst() function - Quick Tutorial
How to use the string lcfirst() function

From About.com

$STRING = lcfirst($STRING);
Perl's lcfirst() function takes a string, makes the first character lowercase, and then returns the new string.
$myWord = 'WORD';
$myLowerWord = lcfirst($myWord);
First, $myWord is set to a value of 'WORD', then the lcfirst() function is run on $myWord. The lcfirst() function takes the first character of $myWord (in this case 'W') and converts it to it's lowercase equivalent. The value of $myLowerWord is then equal to 'wORD'.

This function isn't particularly useful, and is probably just added in for a sense of balance with the ucfirst function.
More Perl Quick Tips
Explore Perl
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

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

All rights reserved.