in reply to Re: Print the string out in alternating upper and lowercase letters LiKe tHiS.
in thread Print the string out in alternating upper and lowercase letters LiKe tHiS.
I rather like one of the SO regex solutions, but without the odd-string-length problem:
c:\@Work\Perl>perl -wMstrict -le "my $s = 'like this'; print qq{'$s'}; ;; $s =~ s{ (.)(.?) }{\U$1\L$2}xmsg; print qq{'$s'}; " 'like this' 'LiKe tHiS'
Give a man a fish: <%-(-(-(-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Print the string out in alternating upper and lowercase letters LiKe tHiS.
by BillKSmith (Monsignor) on Jan 25, 2015 at 21:11 UTC |