Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String search in string array in objective c

I want to search a specific string in the array of strings in objective c. Can somebody help me in this regard?

like image 568
Filthy Knight Avatar asked May 10 '10 11:05

Filthy Knight


1 Answers

BOOL isTheObjectThere = [myArray containsObject: @"my string"]; 

or if you need to know where it is

NSUInteger indexOfTheObject = [myArray indexOfObject: @"my string"]; 

I strongly recommend you read the documentation on NSArray. It's best to do that before posting your question :-)

like image 170
JeremyP Avatar answered Sep 19 '22 18:09

JeremyP