ios - 不区分大小写的比较 NSString

任何人都可以向我指出有关 Objective C 中不区分大小写比较的任何资源吗?它似乎没有与 str1.equalsIgnoreCase(str2)

等效的方法

最佳答案

if( [@"Some String" caseInsensitiveCompare:@"some string"] == NSOrderedSame ) {
  // strings are equal except for possibly case
}

文档位于 Search and Comparison Methods

https://stackoverflow.com/questions/2582306/

相关文章:

objective-c - 开始使用 instancetype 而不是 id 会有好处吗?

ios - 使 UINavigationBar 透明

ios - 如何在 iOS 上获取设备品牌和型号?

objective-c - iOS 8 对尚未渲染的 View 进行快照会导致快照为空

ios - 将 NSString 转换为 NSDate(然后再返回)

ios - 如何在 iOS 上进行 base64 编码?

ios - 在一个 UITableViewCell 上隐藏分隔线

ios - 从 "bouncing"垂直停止 UIWebView?

iphone - 如何在我的 iPhone 应用程序中使用 NSError?

objective-c - 了解 dispatch_async