如何获得NSString(例如@"cake")出现在更大的NSString中的次数(例如@"Cheesecake, apple cake, and cherry pie")?
@"cake"
@"Cheesecake, apple cake, and cherry pie"
我需要在很多字符串上执行此操作,因此无论使用何种方法都需要相对较快.
谢谢!
cocoa substring objective-c nsstring
cocoa ×1
nsstring ×1
objective-c ×1
substring ×1