Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert first character to uppercase?

Status
Not open for further replies.

danielhozac

Programmer
Aug 21, 2001
2,058
SE
How do I convert the first character in a string to uppercase?

//Daniel
 
I'm not a perl expert, but I think you could try

ucfrist $word;

or

"\u\L$word";

hth...mike
 
This should also help....

$str="to upper";

$str =~ s/^(\w)/uc($1)/e;



regards
C "Brahmaiva satyam"
-Adi Shankara (788-820 AD)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top