I need to check if the user is typing a word correctly in a UITextView but the word is repeated multiple times. The rangeOfString() and containsString() methods for strings either check for the specified strings at their first or last occurrence, but I want to check for ALL occurrences of the string.
For example:
var string = "Hi Bloog hi Bloog hi Bloog"
I want to check if "Bloog" is present in the string, and if it is, it should be exactly "Bloog" and not "Bloogg" or "Bloo g" whenever it is repeated How do I do that? Thanks