Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Capitalize the first letter of each word

by injunjoel (Priest)
on Jul 11, 2005 at 19:46 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://474072]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found