【发布时间】:2014-10-17 08:45:38
【问题描述】:
NSString *str = @"Hello {{{separate this}}} and also this {{{ also separate this}}} world"
我需要在数组中输出:
你好 : 在数组中的索引 0
分开:在数组中的索引 1
还有这个:在数组中的索引 2
也分开这个:在数组中的索引 3
世界:在数组中的索引 4
【问题讨论】:
-
使用
NSString方法[str stringByReplacingOccurrencesOfString:<#(NSString *)#> withString:<#(NSString *)#>]和[str componentsSeparatedByString:<#(NSString *)#>]来实现这一点。 -
非常感谢.....
标签: ios objective-c cocoa