in reply to Re^2: 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.

Odd length is only a problem if you have to change the last character. For this case we can use:
use strict; use warnings; my $string = 'athis'; print $string =~ s/(.)(.)/$1.uc$2/egr;
Bill
  • Comment on Re^3: Print the string out in alternating upper and lowercase letters LiKe tHiS.
  • Download Code