Stuck on Challenge 1!


#1

Hey all,
I’m stuck on the second part of the first challenge.

I was able to find the method to use for a case-insensitive search under rangeOfString:options:, but I’m not sure how to go about it to return ‘the actual portion of the string that was found’.

Is it substringWithRange:?


#2

Ok so I think it is substringWithRange:(NSRange)range

but I think that the two methods substringToIndex: and substringFromIndex:

would also apply here too as they will return a portion of the string that was found.


#3

Compared to substringToIndex: and substringFromIndex: methods, substringWithRange:(NSRange)range gives you finer control over the substring which you want to extract. For example, you can extract a fully embedded substring.


#4

Thanks ibex, once again you come to the rescue!