去掉换行之后最后一个字符
2019-01-10 本文已影响5人
一笑wangx
NSString *officeS = [self customModel:[NSString stringWithFormat:@"%@\n%@-%@\n",self.smokeContentLabel.titleLabel.text,insSmokeModel.smokeAreaName,insSmokeModel.smokeName]];
officeS = [officeS stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; //去除掉首尾的空白字符和换行字符
officeS = [officeS stringByReplacingOccurrencesOfString:@"无" withString:@""];//无 为原字符 @“” 为要替换的字符