DEV Community

loading...

Discussion on: Daily Challenge #34 - WeIrD StRiNg CaSe

Collapse
dbalseiro profile image
Diego Balseiro

Here is a little Haskell one-liner

import Data.Char (toUpper, toLower)

toWeirdCase :: String -> String
toWeirdCase = unwords . map (zipWith ($) (cycle [toUpper, toLower])) . words