I have two functions:
lowerString :: [Char] -> [Char]
lowerString = filter (/='_')
upperString :: [Char] -> [Char]
upperString [] = []
upperString (x:xs)
| x == '_' = x : upperString (tail xs)
| otherwise = ' ' : upperString(xs)
If I apply them on "_A_B_CDEF":
upperString "_A_B_CDEF"
would return ___
lowerString "_A_B_CDEF"
would return ABCDEF
(without the spaces)
The idea is to have "upperscored" letters (needed for a bigger exercise).
I never worked with Haskell Input/Output (actually this is my 5th day in Haskell). How do I write a function that receive a [Char]
as input and prints the two strings as output ?