FROM : Ali Ozer
DATE : Sat Jan 11 03:16:35 2003
> 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.
rangeOfString:... and friends return the range in which the argument
string occurs in the receiver.
If the returned range has length 0, then the string does not occur in
the receiver.
Note that due to design of Unicode, it is possible that length of the
returned range is not equal to the length of the target string. If you
need to know where the target string occurs, always use the returned
range.
Ali
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Sat Jan 11 03:16:35 2003
> 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.
rangeOfString:... and friends return the range in which the argument
string occurs in the receiver.
If the returned range has length 0, then the string does not occur in
the receiver.
Note that due to design of Unicode, it is possible that length of the
returned range is not equal to the length of the target string. If you
need to know where the target string occurs, always use the returned
range.
Ali
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Jan Van Boghout | Jan 10, 20:52 | |
| Karl Kraft | Jan 11, 02:03 | |
| Jan Van Tol | Jan 11, 02:10 | |
| Jeff LaMarche | Jan 11, 02:32 | |
| m | Jan 11, 02:51 | |
| Ali Ozer | Jan 11, 03:16 | |
| Jan Van Boghout | Jan 11, 10:18 |






Cocoa mail archive

