將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