Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

perl
lowercase
communitycreator

What is string.lcfirst() in Perl?

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The lcfirst() function converts the first character of a string to lowercase.

The figure below shows a visual representation of the lcfirst() function.

Figure 1: Visual representation of lcfirst() function

Syntax

lcfirst(string)

Parameters

The lcfirst() function requires a string whose first character is to be converted to lowercase.

Return value

The lcfirst() function converts the first character of a string to lowercase. The rest of the string stays the same.

If the string parameter is omitted, then lcfirst() returns an empty string.

Code

#string
print "lcfirst('EDUCATIVE') : ".lcfirst('EDUCATIVE'). "\n";
#string with number
print "lcfirst('EDUCAtIVE09') : ".lcfirst('EDUCAtIVE09'). "\n";
#string is omitted
print "lcfirst() : ".lcfirst(). "\n";

RELATED TAGS

perl
lowercase
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring