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.
例如:字符串是---我想要“书”的书。因为第二次它会变成另一件事。所以我没有使用 NSRange。
任何解决方案?谢谢
NSArray *array = [myString componentsSeparatedByString:@"---"]; NSString *bookString = array[1];
你的问题不是很清楚,但你可能需要使用这个:
NSString* myString = [myPrevString stringByReplacingOccurrencesOfString:@"---" withString:@""];