String compare in iOS
I want to find out whether a given NSString
or CFStringRef
contai开发者_StackOverflowns a certain substring. How do I do that?
- (NSRange)rangeOfString:(NSString *)aString
...is your man. For example:
NSString* search = @"Where's the manual?";
NSRange range = [search rangeOfString: @"the"];
NSLog( @"Found at %u", range.location );
Please read the NSString class reference. What you want is pathExtension.
精彩评论