Skip to content

Instantly share code, notes, and snippets.

@ferostabio
Created July 10, 2011 03:07
Show Gist options
  • Save ferostabio/1074208 to your computer and use it in GitHub Desktop.
Save ferostabio/1074208 to your computer and use it in GitHub Desktop.
NSString category to test whether an NSString contains another one
#import "NSString+Contains.h"
@implementation NSString (Contans)
- (BOOL) containsString: (NSString*) substring
{
NSRange range = [self rangeOfString : substring];
BOOL found = ( range.location != NSNotFound );
return found;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment