CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Change first letter to Upper case

 



waherne
Novice

Jul 14, 2001, 5:07 PM

Post #1 of 3 (761 views)
Change first letter to Upper case Can't Post

Hi all,

I have a variable called $text ="john",
how do I change $text to "John"?

I have tried hard to change the first letter only but gave up. Your help will be appreciated.

Willie




kiseok7
stranger

Jul 14, 2001, 7:48 PM

Post #2 of 3 (758 views)
Re: Change first letter to Upper case [In reply to] Can't Post

it is easy.. you can use "ucfirst" function.

look at perlfunc manpage.

print ucfirst "john";


7;


waherne
Novice

Jul 16, 2001, 6:00 AM

Post #3 of 3 (743 views)
Re: Change first letter to Upper case [In reply to] Can't Post

Thanks 7;

It is indeed so easy once u know where to look!

Willie


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives