iphone - How to search NSArray in Objective C -
hi friends, have array consists of many names. want search names starting character "c". how can search array.
nsstring* firstletter; for(nsstring* currentstring in yourarray) { firstletter = [nsstring stringwithformat:@"%c", [currentstring characteratindex:0]]; if([firstletter isequaltostring:@"c"]) { // name ok } else { // name wrong } }
Comments
Post a Comment