The uc()
function in Perl converts a string to uppercase.
The following figure shows a visual representation of the uc()
function.
uc(string)
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$_
.
The uc()
function returns a string that is converted to uppercase.
The following code illustrates how to use uc()
function in Perl.
#Stringprint "uc('educative') : ".uc('educative'). "\n";#String with numberprint "uc('educative09') : ".uc('educative09'). "\n";#String is omittedprint "uc() : ".uc(). "\n";