将nsstring中的多个字符替换为其他多个字符?将nsstring中的多个字符替换为其他多个字符
NSString *jobs = @"The designs of the iPhone 6 and iPhone 6 Plus were influenced by that of the iPad Air, with a glass front that is curved around the edges of the display,and an aluminum rear that contains two plastic strips for the antenna; both models come in gold, silver, and space gray finishes";
NSString * jobs2 = [jobs stringByReplacingOccurrencesOfString:@" "withString:@"_"];
NSLog(@" string is %@ ",jobs2);
它代替空格(”“),以 “ - ”
,但我想用@ 个替换$ ^ h替换#替换,,等
所有单一功能到 将nsstring中的多个字符替换为其他多个字符?
您可以编写自己的类别,这 – 2015-02-10 06:00:06
我不知道,弄不明白,请帮我 – appintosh 2015-02-10 06:28:42
谷歌什么的obj C三类是..你可以写你的自己的方法来实现你想要的,并使它成为使用类别的NSString类的一部分。 – 2015-02-10 06:51:34