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)
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)
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