|
|
Tutorials

Perl

|
Topic |
What is ucfirst Function in Perl?
|
|
Explanation |
|
The ucfirst function is used to returns a string with first letter in upper case.
Syntax:
ucfirst(string)
In the above syntax, ucfirst() takes a "string" as the argument.
Example:
#! C:\programfiles\perl\bin\perl
print "content-type: text/html\n\n";
$string = "good day";
$string2 = ucfirst($string);
print "First letter in Upper Case: $string2\n";
Result:
First letter in Upper Case: Good day
In the above ucfirst function example in the string "good day" the first letter "g" is converted to uppercase "G".
|
|
A Note |
|
Simple introduction, basic CGI perl programming codes with examples.
Do send your feedback or suggestions on this tutorial.
This is a copyright content.
|
|
|
|