Jan 4, 2011

Perl string uc() function

Perl string uc() function:

$STRING = uc($STRING);

Perl's uc() function takes a string, makes the entire thing uppercase, and then returns the new string.

$myWord = 'word';
$myUpperWord = uc($myWord);

First, $myWord is set to a value of 'word', then the uc() function is run on $myWord. The uc() function takes the entire string $myWord and converts it to it's uppercase equivalent. The value of $myUpperWord is then equal to 'WORD'.

No comments:

Post a Comment