Perl | lcfirst() Function
lcfirst() function in Perl returns the string VAR or $_ after converting the First character to lowercase.
Syntax: lcfirst(VAR)
Parameter:
VAR: Sentence whose first character is to be converted to lower case
Returns: the string VAR or $_ with the first character lowercased
Example 1:
#!/usr/bin/perl # Original String containing both # lower and upper case letters $orignal_string = "GEEkS FoR geEkS"; # Converting the First character to Lower case $changed_string = lcfirst($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 first character to Lower case $changed_string = lcfirst($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 | oct() Function
- Perl | chr() Function
- Perl | ord() Function
- Perl | hex Function
- Perl | int() function
- Perl | abs() function
- Perl | log() Function
- Perl | exp Function
- Perl | uc() Function
- Perl | tell() Function
- Perl | sin() Function
- Perl | cos() Function
- Perl | each() Function
- Perl | atan2() Function
- Perl | getc 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.



