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

Devang picture Devang · Apr 6, 2011 · Viewed 28.2k times · Source

I have some string name and I want to compare whether that string contains substring like "_thumb.png".

Answer

unexpectedvalue picture unexpectedvalue · Apr 6, 2011
[string rangeOfString:string1].location!=NSNotFound

rangeOfString: documentation.