Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by galande (Initiate)
on Nov 24, 2000 at 13:32 UTC ( #43203=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > What is the best way to capitalize a string? - Answer contributed by galande

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
Chatterbox?
[LanX]: missing for month
[LanX]: D : Oberbefehlshaber
[GotToBTru]: yeah, thats the story I remember. some card the President is supposed to carry around at all times
[GotToBTru]: I suppose the actual details about what is necessary to actually do something is kept fuzzy deliberately
[LanX]: the interview was with the guy who designed the process
[LanX]: in the 70s
[GotToBTru]: so the font on the card is probably NOT Comic Sans
[GotToBTru]: that's a relief

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2017-01-20 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.