忽然笑
你可以使用这个方法- (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement...获取一个替换了子字符串的新字符串(参见NSString其他文档)使用示例NSString *str = @"This is a string";str = [str stringByReplacingOccurrencesOfString:@"string" withString:@"duck"];