Perl Newbies

  1. Perl
  2. Functions
  3. here

ucfirst function - Convert lowercase first character of string to uppercase

ucfirst function convert lowercase first character of string to uppercase.

# Convert lowercase first character of string to uppercase
$ret = ucfirst $string;

ucfirst function programing example

ucfirst function programing example.

use strict;
use warnings;

# Convert "foo" to "Foo"
my $str = ucfirst "foo";

print "$str\n";

Output:

Foo

ucfirst function relative information

Menu