Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

perl
string
uppercase
communitycreator

What is the uc() function in Perl?

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The uc() function in Perl converts a string to uppercase.

The following figure shows a visual representation of the uc() function.

Visual representation of uc() function

Syntax

uc(string)

Parameter

The uc() function requires only one parameter: a string that is to be converted to uppercase.

If the string parameter is omitted then it returns $_.

Return value

The uc() function returns a string that is converted to uppercase.

Code

The following code illustrates how to use uc() function in Perl.

#String
print "uc('educative') : ".uc('educative'). "\n";
#String with number
print "uc('educative09') : ".uc('educative09'). "\n";
#String is omitted
print "uc() : ".uc(). "\n";

RELATED TAGS

perl
string
uppercase
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring