What is string.lc() in Perl?

The lc() function converts a string to lowercase.

The following figure shows a visual representation of the lc() function.

Figure 1: Visual representation of lc() function

Syntax

lc(string)

Parameter

As a parameter, the lc() function requires a string that is to be converted to lowercase.

Return value

The lc() function returns a string that is converted to lowercase.

If the string parameter is omitted, then it returns ''.

Code

#string
print "lc('EDUCATIVE') : ".lc('EDUCATIVE'). "\n";
#string with number
print "lc('EDUCATIVE09') : ".lc('EDUCATIVE09'). "\n";
#string is omitted
print "lc() : ".lc(). "\n";
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources