Is there a method built in to NSString that tokenizes the string and searches the beginning of each token? the compare
method seems to only do the beginning of a string, and using rangeOfString
isn't really sufficient because it doesn't have knowledge of tokens. Right now I'm thinking the best way to do this is to call
[myString componentsSeparatedByString:@" "]
and then loop over the resulting array, calling compare on each component of the string. Is this built-in and I just missed it?