Let's say I have:
this - is an - example - with some - dashes
NSRange
will pick up the first instance of "-" with `rangeOfString:@"-" but what if I only want the last one?
I'm looking for something that works similar to lastIndexOf
in JS
. Thanks!
One of the options you can pass to [NSString rangeOfString: options:]
is NSBackwardsSearch (which would give you the last item in the string you're looking at).