Files
haskell/stringManip.hs

19 lines
332 B
Haskell
Raw Normal View History

2017-02-07 20:06:59 +00:00
module StringManip where
import Data.Char
uppercase, lowercase :: String -> String
uppercase = map toUpper
lowercase = map toLower
capitalise :: String -> String
capitalise x =
let capWord (x:xs) = toUpper x : xs
in unwords (map capWord (words x))
yy :: String -> String
yy a =
let capWord (a:b) = toUpper a : b
in a