美文网首页
去掉换行之后最后一个字符

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

作者: 一笑wangx | 来源:发表于2019-01-10 14:20 被阅读5次

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

    相关文章

      网友评论

          本文标题:去掉换行之后最后一个字符

          本文链接:https://www.haomeiwen.com/subject/whkarqtx.html