相关疑难解决方法(0)

仅替换NSString中子字符串的第一个实例

所以如果你有一个NSString:

@"My blue car is bigger than my blue shoes or my blue bicycle";
Run Code Online (Sandbox Code Playgroud)

我想要一个方法,只用蓝色替换第一个蓝色实例,以产生:

@"My green car is bigger than my blue shoes or my blue bicycle";
Run Code Online (Sandbox Code Playgroud)

怎么做到这一点?

iphone xcode objective-c nsstring

36
推荐指数
5
解决办法
2万
查看次数

标签 统计

iphone ×1

nsstring ×1

objective-c ×1

xcode ×1