Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: What is the best way to capitalize a string?

by galande (Initiate)
on Nov 24, 2000 at 13:32 UTC ( [id://43203]=note: print w/replies, xml ) Need Help??


in reply to What is the best way to capitalize a string?

You can use uc or lc built-in functions to change case. If you wanto to change case of first character only, then use ucfirst or lcfirst functions.

$lower = "name"; $upper = "NAME"; print uc($lower),"\n"; ### This will print : NAME print lc($upper),"\n"; ### This will print : name print ucfirst($lower),"\n"; ## This will print : Name print lcfirst($upper),"\n"; ## This will print : nAME

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://43203]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-24 10:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found