Capitalize with ucfirst : ucfirst « String « Perl






Capitalize with ucfirst

   


#!/usr/bin/perl
use warnings;
use strict;

my @array = ("onE", "two", "THREE", "fOUR", "FiVe");
foreach (@array) {
   $_ = ucfirst lc;   # lc uses $_ by default with no argument
}
print join(',', @array);

   
    
    
  








Related examples in the same category

1.Only change first letter to uppercase
2.Using ucfirst function