Friday, May 6, 2011

NSString search using NSRange example

An example code for matching NSString object using NSRange.


- (BOOL)matchString:(NSString *)theString withString:(NSString*)withString {
NSRange range = [theString rangeOfString:withString];
int length = range.length;
if (length == 0) {
return NO;
}
return YES;
}