I have to write a cutString :: String -> [String] function that has to cut a string into a list of strings. It should cut at the '.' characters.
For example:
cutString "this.is.a.string" == ["this","is","a","string"]
cutString "" == [""]
cutString ".." == ["",""]
cutString ".this.is.a.string." == ["","this","is","a","string",""]
So far, I have this:
cutString [] = []
cutString [x]
| x == '.' = []
| otherwise = [[x]]
cutString (x:xs) = cutString [x] ++ cutString xs
Which leaves out only the periods (this part is desirable), but also cuts the whole string up character by character.
Like this:
["t","e","s","t","t","e","s","t","2"]