Separating NSString into NSArray, but allowing quotes to group words
问题 I have a search string, where people can use quotes to group phrases together, and mix this with individual keywords. For example, a string like this: "Something amazing" rooster I'd like to separate that into an NSArray, so that it would have Something amazing (without quotes) as one element, and rooster as the other. Neither componentsSeparatedByString nor componentsSeparatedByCharactersInSet seem to fit the bill. Is there an easy way to do this, or should I just code it up myself? 回答1: You