Let's say the user is allowed the enter a string like this
hello how are you I am a bad boy
Now let's say we have to detect for profanity against an array of bad words
bad
long neck
abc
def
...
I want to be able to detect if the user enters in bad, but if they said baddie that's ok. And it's not just spaces, but also other punctuation is allowed to break up the words. For example:
I am a baddie //pass
I am a bad,die //fail
I am a bad die //fail
I have a longneck //pass
I have a long neck //fail
I have a long, neck //pass
I have a neck long //pass
How can this be done in swift?