去掉换行之后最后一个字符

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:@""];//无 为原字符 @“” 为要替换的字符

你可能感兴趣的:(去掉换行之后最后一个字符)