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 中搜索特定的最后一个字符,但找不到方法。例如,在 C# 中,我可以执行 lastindexof 来获取我正在搜索的 char 的索引,然后使用 substring 来获取我想要的内容。Obj C 中有没有办法实现这一点?
NSString *s = @"aabbcc"; [s rangeOfString:@"b" options:NSBackwardsSearch]; // {3, 1}