DEV Community

Discussion on: Daily Challenge #95 - CamelCase Method

Collapse
 
craigmc08 profile image
Craig McIlwrath

Haskell:

import Data.Char (toUpper, toLower)

camelCase :: String -> String
camelCase = unwords . map toCamel . words
            where toCamel (x:xs) = toUpper x ++ map toLower xs