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: m <email@hidden>
- Date: Sat, 11 Jan 2003 01:51:40 +0000
On Friday, January 10, 2003, at 07:52 PM, Jan Van Boghout wrote:
I guess this is one of those things I'll smack myself for, but I can't
find a good way to do it:
How do I know if a string contains another string? Something like
myBool = [myString containsString:@"bla"] is what I need.
Any pointers?
How about
NSRange subStrRange = [myString rangeOfString:@"bla"];
myBool = (subStrRange.location != NSNotFound);
BTW, I find that "Cocoa Broswer" is invaluable for finding things like
this.
http://homepage2.nifty.com/hoshi-takanori/cocoa-browser/
_murat
_______________________________________________
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.