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.
我使用 componentsSeparatedByString 将一个字符串分成 2 部分,分成一个数组,用“-”分隔。事实证明,有些数据是用“a”和“-”分隔的。我可以添加第二个“谓词”来说明这种情况吗?
试试这个:
[string componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"-a"]];