tags:

views:

36

answers:

1

HI friends, I have an array consists of many names. I want to search the names starting from the character "c". How can I search the array.

+2  A: 
NSString* firstLetter;

for(NSString* currentString in yourArray)
{
     firstLetter = [NSString stringWithFormat:@"%d", [currentString characterAtIndex:0]];
     if([firstLetter isEqualToString:@"c"])
     {
          // NAME OK
     }
     else
     {
         // NAME WRONG
     }
} 
MathieuF
@MathieuF: Thanks Bro :-)
Harsh