views:

44

answers:

1

I am interested in searching a string (using objective-c) starting from a specific character in the middle of the string. I could split the string, but is there another way? I don't see an obvious option for that in the definition of NSString. I want to be able to search either backwards or forwards in the string starting from a defined character.

+7  A: 

-[NSString rangeOfString:options:range:]. Use the range parameter to tell the string to only look in a sub-portion of the original string for the search string.

Dave DeLong