in reply to
uc() every other letter
How about a generic solution with a regex? Turn
@lcase
into a string, then
$lcase =~ s/(\w{1})(\w{1})/{$1.uc$2}/eg;
§
George Sherston
Comment on
Re: uc() every other letter
Select
or
Download
Code
Replies are listed 'Best First'.
Re: Re: uc() every other letter
by
stefp
(Vicar)
on Sep 28, 2001 at 18:01 UTC
simpler:
$lcase =~ s/(\w)(\w)/\l$1\u$2/g
--
stefp
[reply]
[d/l]
Re: Re: Re: uc() every other letter
by
George_Sherston
(Vicar)
on Sep 28, 2001 at 21:06 UTC
Smart! Every day I learn something. Hmm. And if it's short we want, one might go as far as
s/(.)(.)/$1\u$2/g
§
George Sherston
[reply]
[d/l]
In Section
Seekers of Perl Wisdom