Perl lcfirst Function



Description

This function returns the string EXPR or $_ with the first character lowercased.

Syntax

Following is the simple syntax for this function −

lcfirst EXPR

lfirstc

Return Value

This function returns the string EXPR or $_ with the first character lowercased.

Example

Following is the example code showing its basic usage −

#!/usr/bin/perl

$orig_string = "This is Test and CAPITAL";
$changed_string = lcfirst( $orig_string );

print "Changes String is : $changed_string\n";

When above code is executed, it produces the following result −

Changes String is : this is Test and CAPITAL
perl_function_references.htm
Advertisements