NSString question - rangeOfString method

Viewed 53806

I am having an issue that I can't figure out.

I'm trying to run the rangeOfString method on a string, and I'm not sure how to determine if the string was not found. For example:

NSRange range = [@"abc" rangeOfString:@"d" options:NSCaseInsensitiveSearch range:NSMakeRange(0,3)];

Clearly, "d" is not contained in the string "abc." I'd like to be able to do this:

if(the range is empty since "d" is not in "abc")
   //do something

What is the code for this?

Thanks!!

2 Answers
Related