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";

Free Resources