我有这个字符串:
Charle,Mike,Stephan,Andre,Jenny,
我只想得到:
Charle
Mike
Stephan
Andre
Jenny
所以只是提取基于,
字符的单词,哪个函数可以在cocoa中执行此操作?
答案 0 :(得分:4)
NSString *string = @"Charle,Mike,Stephan,Andre,Jenny,";
NSArray *names = [string componentsSeparatedByString: @","];