"Paul's! Come There"
"paul s come there"
myFilter :: String -> String
myFilter str = unwords . filter (not . null) . map (
map toLower . filter isLetter
) . words $ str
如何将字母过滤到lowerCase中,同时用空格替换所有非字符号?
答案 0 :(得分:1)
@Cirdec这个想法。要使语法正确,将是map
Hello!
(注意括号)与(\c -> if not (isLetter c) then ' ' else c)