Hi everyone,
WOW a lot of responses! Thanks for your help. I didn't pick up on the
-rangeOfString: method as useful for searching when looking through
the documentation. But I see how it fits in now.
Cheers!
Dan.
___
Discuss-gnustep mailing
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
Daniel J Farrell wrote:
Hello,
What is the easiest way to search the contents of an NSString for the
occurrence of a word?
For example, if I have @GNUStep is really cool, how can I find out if
this contains the string @cool? I just need
On May 1, 2007, at 11:38 AM, Sašo Kiselkov wrote:
BOOL ContainsString (NSString *string, NSString *keyword)
{
return [string rangeOfString: keyword].location != NSNotFound;
}
Slightly better:
BOOL ContainsString (NSString *string, NSString *keyword)
{
return (string != NULL) ([string
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
Adam Fedor wrote:
On May 1, 2007, at 11:38 AM, Sašo Kiselkov wrote:
BOOL ContainsString (NSString *string, NSString *keyword)
{
return [string rangeOfString: keyword].location != NSNotFound;
}
Slightly better:
BOOL ContainsString