开发者

String compare in iOS

I want to find out whether a given NSString or CFStringRef contai开发者_StackOverflowns a certain substring. How do I do that?


- (NSRange)rangeOfString:(NSString *)aString

...is your man. For example:

NSString* search = @"Where's the manual?";
NSRange range = [search rangeOfString: @"the"];
NSLog( @"Found at %u", range.location );


Please read the NSString class reference. What you want is pathExtension.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜