Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Capitalize the first letter of each word

by injunjoel (Priest)
on Jul 11, 2005 at 19:46 UTC ( #474072=note: print w/replies, xml ) Need Help??


in reply to Capitalize the first letter of each word

Greetings all,
Yet another way to do it.
use strict; my $text = "to say it once"; $text =~ s/(\w+)/\u\L$1/g; print $text;
produces:
To Say It Once

-InjunJoel
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo

Replies are listed 'Best First'.
Re^2: Capitalize the first letter of each word
by brian_d_foy (Abbot) on Jul 11, 2005 at 20:26 UTC

    Of course, your solution is broken for the reasons I explain in perlfaq4.

    --
    brian d foy <brian@stonehenge.com>
      Thanks for the heads up.

      -InjunJoel
      "I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2019-07-23 05:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (24 votes). Check out past polls.

    Notices?