Skip to content

Instantly share code, notes, and snippets.

@AtomicCat
Created September 16, 2011 00:46
Show Gist options
  • Select an option

  • Save AtomicCat/1220903 to your computer and use it in GitHub Desktop.

Select an option

Save AtomicCat/1220903 to your computer and use it in GitHub Desktop.
numeric comparison
NSCharacterSet *stripSet = [NSCharacterSet characterSetWithCharactersInString:@"."];
val1 = [[val1 componentsSeparatedByCharactersInSet:stripSet] componentsJoinedByString:@""];
val2 = [[val2 componentsSeparatedByCharactersInSet:stripSet] componentsJoinedByString:@""];
return [val1 compare:val2 options:NSNumericSearch | NSCaseInsensitiveSearch];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment