Re: How to know if an NSString contains a string?
Re: How to know if an NSString contains a string?
- Subject: Re: How to know if an NSString contains a string?
- From: Karl Kraft <email@hidden>
- Date: Fri, 10 Jan 2003 19:03:09 -0600
How do I know if a string contains another string? Something like
myBool = [myString containsString:@"bla"] is what I need.
NSRange aRange = [myString rangeOfString:@"bla"];
if (aRange.location ==NSNotFound) {
NSLog(@"string not found");
} else {
NSLog(@"string was at index %d ",aRange.location);
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.