$line =~ s/(\w)(\S*)/\u$1$2/g;

Salvador Lopez wrote:
> 
> Hello All,
> 
> how can i convert only the first letter of each word
> in a string without changing any other characters?
> Is this a job for regular expressions?
> 
> For example, convert:
> 
> FROM: "hello world. goodbye    cruel       world"
> 
> TO:   "Hello World. Goodbye    Cruel       World"
> 
> any help is appreciated.
> 
> --sal
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

--
http://www.5vs1.com - A Pearl Jam Fan Site

"Only when the last tree is dead, the last river damned, and the last
field paved, will we realize that we can't eat money."

"Time is long and life is short, so begin to live while you still can."
                        -Eddie Vedder

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to