Skip to content

Instantly share code, notes, and snippets.

@akfreas
Created October 2, 2013 04:00
Show Gist options
  • Save akfreas/6788980 to your computer and use it in GitHub Desktop.
Save akfreas/6788980 to your computer and use it in GitHub Desktop.
Plurality correctness
NSString *pluralString;
NSString *lastComponent = [person.firstName substringWithRange:NSMakeRange(firstName - 1, 1)];
if ([lastComponent isEqualToString:@"s"]) {
pluralString = @"'";
} else {
pluralString = @"'s";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment