Perl lcfirst Function

Advertisements


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 produced following result

Changes String is : this is Test and CAPITAL


Advertisements
Advertisements