I have a UITextField called textfield. And I have this code to check if the text in the textfield is equal to "exampletext"
if ([textfield.text isEqualToString:@"exampletext"]) {
NSLog(@"Correct");
} else {
NSLog(@"Wrong");
}
But I also want to check if the text in the textfield is almost equal to "exampletext", if the text is almost the same as "exampletext". Like if the text was "eampletex" I want to NSLog(@"Close")
Are there any ways to check if the textfield text is like 50% equal to "exampletext"? Or any ways to check if the textfield text has 50% the same characters as "exampletext"? Or something else like that?