I have a list of strings
["This!","i2s","a","li!st","of","strings"]
And I want to make a function such that it removes all the special characters from individual strings
["This", "is", "a", "list", "of", "strings"]
I made a function like this(I'm only considering ! as special characters for now):
removeUglyCharacters []=[]
removeUglyCharacters (x:xs) | x == "!" = removeUglyCharacters xs
| otherwise = x:removeUglyCharacters xs
However, if I understand correctly, this will check if one string is an exclamation and then continue.
*Main> let abc = ["this","wont","work","as!","intended","!"]
*Main> removeUglyCharacters abc
["this","wont","work","as!","intended"]
It will not check every character in a string and remove the exclamation. I just can't seem to figure out how to do this. I was thinking along the lines of needing a pattern match for every individual string too?