1. Perl
  2. builtin functions
  3. here

ucfirst function - converts the beginning of a string from lowercase to uppercase

You can use the ucfirst function to convert only the beginning of a string from lowercase to uppercase.

# Convert first letter to uppercase
$ret = ucfirst $string;

Programming example for ucfirst function

This is a programming example of the ucfirst function.

use strict;
use warnings;

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

print "$str\n";

Output result

Foo

Related information of ucfirst function

Related information for the ucfirst function.

Related Informatrion