Skip to content

Instantly share code, notes, and snippets.

@stevenhuey
Created December 7, 2012 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenhuey/4235804 to your computer and use it in GitHub Desktop.
Save stevenhuey/4235804 to your computer and use it in GitHub Desktop.
ObjectiveSugar2
NSArray *cars = [@"Testarossa", @"F50", @"F458 Italia"];
// or NSSet *cars = [NSSet setWithObjects:@"Testarossa", @"F50", @"F458 Italia", nil];
[cars map:^id(id car){
return @([[car substringToIndex:1] isEqualToString:@"F"]);
}];
// NO (Testarossa)
// YES (F50)
// YES (F458 Italia)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment