Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个NSString看起来像这样的@"1, 5, 23, 15, 6"。我需要的是从这个字符串中检索所有这些数字。可能结果可能看起来像一个 NSStrings 数组 - @"1", @"5",@"23"等等。我怎么做?
NSString
@"1, 5, 23, 15, 6"
@"1"
@"5"
@"23"
NSString *string = @"1, 5, 23, 15, 6"; NSArray *chunks = [string componentsSeparatedByString: @", "];