Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Capitalize First Letter of Each Word

by Random_Walk (Prior)
on Jun 30, 2005 at 13:13 UTC ( [id://471297]=note: print w/replies, xml ) Need Help??


in reply to Capitalize First Letter of Each Word

This looks like one of the infamous homework problems ... What have you tried so far ? Here is a solution that works but won't get you many marks for homework ;)

perl -ne'$l=" ";for(split//){$_=$l eq" "?uc$_:lc$_;print;$l=$_}'

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-03-28 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found