Perl | lc() Function for Lower Case Conversion
lc() function in Perl returns a lowercased version of VAR, or $_ if VAR is omitted.
Syntax: lc(VAR)
Parameter:
VAR: Sentence which is to be converted to lower caseReturn:
Lowercased version of VAR, or $_ if VAR is omitted
Example 1:
#!/usr/bin/perl # Original String containing both # lower and upper case letters $orignal_string = "GEEkS FoR geEkS"; # Converting the string to Lower case $changed_string = lc($orignal_string); # Printing the original String print "Original String : $orignal_string\n"; # Printing the Changed String print "Changed String : $changed_string\n"; |
chevron_right
filter_none
Output:
Original String : GEEkS FoR geEkS Changed String : geeks for geeks
Example 2:
#!/usr/bin/perl # Original String containing # lower and upper case letters # as well as numerics $orignal_string = "G33kS F0R g3EkS"; # Converting the string to Lower case $changed_string = lc($orignal_string); # Printing the original String print "Original String : $orignal_string\n"; # Printing the Changed String print "Changed String : $changed_string\n"; |
chevron_right
filter_none
Output:
Original String : G33kS F0R g3EkS Changed String : g33ks f0r g3eks
Recommended Posts:
- Perl | Automatic String to Number Conversion or Casting
- Perl | hex Function
- Perl | each() Function
- Perl | uc() Function
- Perl | exp Function
- Perl | oct() Function
- Perl | sin() Function
- Perl | ord() Function
- Perl | tell() Function
- Perl | log() Function
- Perl | abs() function
- Perl | cos() Function
- Perl | chr() Function
- Perl | int() function
- Perl | srand() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



