On 2003.07.11 12:32 Erich C. Beyrent wrote:
Hi there,

I was hoping someone could come up with an efficient way of doing a ucfirst
lc on each word in the block below:

1{0e}TRUE DREAM{0e}6-1{0e}{0e}4{0e}SP'S SLIM SHADY{0e}10-1/l
2{0e}HARLEIGH GIRL{0e}8-1{0e}{0e}5{0e}FLYING SWEET AMY{0e}8-1/l
3{0e}REKO THEODORE{0e}7-2{0e}{0e}6{0e}MOON MT CHEETAH{0e}5-2/l
4{0e}SP'S SLIM SHADY{0e}10-1{0e}{0e}8{0e}JUST SO YOU KNOW{0e}9-2/l

$block =~ s/([A-Z']+)/ucfirst lc $1/eg;


1{0e}True Dream{0e}6-1{0e}{0e}4{0e}Sp's Slim Shady{0e}10-1/l
2{0e}Harleigh Girl{0e}8-1{0e}{0e}5{0e}Flying Sweet Amy{0e}8-1/l
3{0e}Reko Theodore{0e}7-2{0e}{0e}6{0e}Moon Mt Cheetah{0e}5-2/l
4{0e}Sp's Slim Shady{0e}10-1{0e}{0e}8{0e}Just So You Know{0e}9-2/l

Note that this turns "SP'S" into "Sp's". If you can do without the "'", you would probably get prettier output.

Randy
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray        Campbell, CA    http://www.rjray.org    [EMAIL PROTECTED]

Silicon Valley Scale Modelers: http://www.svsm.org
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to