How can I calculate the number of differences between two NSStrings.
Example:
NSString 1 = "this is a string"
NSString 2 = "Tihs isa string"
should return: 4 (one for the capital “T”, one for the “i”, the “h” and for the missing space)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you’re looking for is the Levenshtein Distance.
An implementation in Objective-C:
Author of the source above: Rick Bourner, http://www.merriampark.com/ldobjc.htm