NSString tokenize in Objective-C
问题 What is the best way to tokenize/split a NSString in Objective-C? 回答1: Found this at http://borkware.com/quickies/one?topic=NSString (useful link): NSString *string = @"oop:ack:bork:greeble:ponies"; NSArray *chunks = [string componentsSeparatedByString: @":"]; Hope this helps! Adam 回答2: Everyone has mentioned componentsSeparatedByString: but you can also use CFStringTokenizer (remember that an NSString and CFString are interchangeable) which will tokenize natural languages too (like Chinese