如何从两个分隔符中提取

时间:2010-08-31 14:36:28

标签: iphone objective-c

1+2+3:4+5+6:7+8+9

如果我有两个分隔符+和如何分隔: 我正在使用数组来存储

myarray1 = [myarray2 componentsSeparatedByString:@":"]; delimit only :

1 个答案:

答案 0 :(得分:4)

NSString *myString = @"Foo-bar/blee";
NSArray *myWords = [myString componentsSeparatedByCharactersInSet:
                      [NSCharacterSet characterSetWithCharactersInString:@"-/"]
                    ];