Answers:
NSArray *arrayOfComponents = [yourString componentsSeparatedByString:@":"];
yourString所在的位置 @"one:two:three"
和arrayOfComponents将包含 @[@"one", @"two", @"three"]
您可以使用 NSString *comp1 = arrayOfComponents[0];
(https://developer.apple.com/documentation/foundation/nsstring/1413214-componentsseparatedbystring)
使用这个:[[string componentsSeparatedByString:@“,”] [0];
[NSArray componentsJoinedByString:]
。