【发布时间】:2013-03-13 16:35:11
【问题描述】:
我想从给定索引处的 NSString 中提取一个子字符串。示例:
NSString = @"Hello, welcome to the jungle";
int index = 9;
索引点 '9' 位于单词 'welcome' 的中间,我希望能够将单词 'welcome' 提取为子字符串。谁能告诉我如何实现这一目标?使用正则表达式?
【问题讨论】:
-
你想要'e'还是'welcome'?
-
我想要“欢迎”这个词
-
这个问题不是无效的吗?为什么有人会去寻找正则表达式或nsset?使用 nsstring 类的方法可以很容易地找到它。
标签: ios cocoa nsstring substring