To convert a string to lowercase in Perl, you can use the lc
function.
In this example,
$str
with the value "Hello World"
.lc
on $str
to convert it to lowercase.$str
.$str = 'Hello World';
$lowercase_str = lc $str;
print $lowercase_str;
hello world
In this example,
$str
with the value "Perl Programming"
.lc
on $str
to convert it to lowercase.$str
.$str = 'Perl Programming';
$lowercase_str = lc $str;
print $lowercase_str;
perl programming
In this tutorial, we learned How to convert String to Lowercase in Perl language with well detailed examples.