9 lines
326 B
Mathematica
9 lines
326 B
Mathematica
|
|
NSArray *haystack = @[@"Zig",@"Zag",@"Wally",@"Ronald",@"Bush",@"Krusty",@"Charlie",@"Bush",@"Bozo"];
|
||
|
|
for (id needle in @[@"Washington",@"Bush"]) {
|
||
|
|
int index = [haystack indexOfObject:needle];
|
||
|
|
if (index == NSNotFound)
|
||
|
|
NSLog(@"%@ is not in haystack", needle);
|
||
|
|
else
|
||
|
|
NSLog(@"%i %@", index, needle);
|
||
|
|
}
|