Skip to content

Instantly share code, notes, and snippets.

iOS for life

Kristina Fox krstnfx

iOS for life
View GitHub Profile

Keybase proof

I hereby claim:

  • I am krstnfx on github.
  • I am kristina ( on keybase.
  • I have a public key whose fingerprint is D33A 5FF7 8685 93E2 56BF 1789 11AA FAAA CAA1 3850

To claim this, I am signing this object:

krstnfx / Levenshtein
Last active Aug 29, 2015 — forked from quietcricket/gist:1593632
Levenshtein to get edit distance between two strings (ignores newlines, but counts spaces)
View Levenshtein
-(float)compareString:(NSString *)originalString withString:(NSString *)comparisonString
// Normalize strings
[originalString stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
[comparisonString stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
originalString = [originalString lowercaseString];
comparisonString = [comparisonString lowercaseString];
// Step 1 (Steps follow description at