NSString indexOf在Objective-C [英] NSString indexOf in Objective-C

查看:116
本文介绍了NSString indexOf在Objective-C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在NSString对象中是否有类似于 indexOf 的函数?

Are there anything similar to an indexOf function in the NSString objects?

推荐答案

使用 - [NSString rangeOfString:]

- (NSRange)rangeOfString:(NSString *)aString;




查找并返回给定字符串第一次出现的范围

Finds and returns the range of the first occurrence of a given string within the receiver.

这篇关于NSString indexOf在Objective-C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆