【发布时间】:2014-09-02 21:45:18
【问题描述】:
什么是最简单的方法,给定一个字符串:
NSString *str = @"Some really really long string is here and I just want the first 10 words, for example";
生成一个带有前 N 个(例如 10 个)单词的 NSString?
编辑:如果str 比 N 短,我还想确保它不会失败。
【问题讨论】:
标签: objective-c string nsstring