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.
我想扫描一个 NSString 以找到该文本:“S:027,13”然后如果扫描找到该文本(创建条件)
我找到了一些关于 NSScanner 的解释,但是对于我想做的“简单”事情来说,开发得太多了......
如果有人能照亮我的路:-)
非常感谢!
if ([string rangeOfString:@"S:027,13"].location != NSNotFound)
我很确定您正在寻找这个:https ://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/ instm/NSString/rangeOfString: