iPhone : How to check whether a substring exists in a string?

标签 iphone objective-c cocoa-touch ios4

我有一些字符串名称,我想比较该字符串是否包含像“_thumb.png”这样的子字符串。

最佳答案

[string rangeOfString:string1].location!=NSNotFound

rangeOfString:文档。

关于iPhone : How to check whether a substring exists in a string?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5565038/

相关文章:

ios - 以编程方式使用自动布局约束的问题

iphone - 如何在 iPhone 中测量噪音或声音并以 dB(A) 为单位显示?

iphone - PDFKit 框架可在 iPhone 操作系统上使用吗?

ios - 较小时 UIScrollView 的中心内容

iphone - 是否可以保证iPhone应用程序可以在iPod touch上运行?

ios - 如何快速获取 iPhone 上的本地主机 IP 地址?

iphone - 在iPhone上更改“返回键”

iphone - 如何在 Objective-C 中格式化 Facebook/Twitter 日期(来自 JSON 提要)

ios - 自定义推送和弹出动画 iOS 7 和 8

iphone - 变换后获取帧值的最佳方法?