I would like to count my NSArray object of my NSString. My NSArray has @"a", @"w" objects, and my string is @"abcdefgw". I would like to know how many times the @"w" object is there in my string.
I would like to count my NSArray object of my NSString. My NSArray has
Share
You can use
- (NSArray *)componentsSeparatedByString:(NSString *)separator, though this may have boundary issues. You can also usestringByReplacingOccurrencesOfString:withString:like this: