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.

A more robust solution if you like:
perl -CO -Mutf8 -E 'say map { /\P{Cased}/ ? $_ : $c++ % 2 ? lc : uc } "comme ça" =~ /(\X)/g'
Of course, at this point we should perhaps consider ucfirst and fc...
  • Comment on Re^2: Print the string out in alternating upper and lowercase letters LiKe tHiS.
  • Download Code

Replies are listed 'Best First'.
Re^3: Print the string out in alternating upper and lowercase letters LiKe tHiS.
by Anonymous Monk on Jan 26, 2015 at 14:22 UTC
    (a typo; /^\P{Cased}/, of course, or else it can find these annoying combining marks...)