去掉某个字符:
NSString *str = @"大家好,我是某某某";
NSString *quStr = [str stringByReplacingOccurrencesOfString:@"某某某" withString:@""]; //去掉空格
把某个字符替换成别的字符:
NSString *tiStr = [str stringByReplacingOccurrencesOfString:@"某某某" withString:@"哈喽"];//替换字符
喜欢点个赞!
END.
网友评论