如何将敏感字变成***

NSString* search = @"擦擦擦";

NSString* replace = @"***";

NSMutableString*mstr = [[NSMutableStringalloc]initWithString:@"dafkasdhf擦擦擦kasddsf"];

NSRangerange = [mstr rangeOfString:search];

[mstr replaceCharactersInRange:range withString:replace];

NSLog(@"____________%@",master);

你可能感兴趣的:(如何将敏感字变成***)