iphone--字符串去除空格

来源:互联网 发布:淘宝女装店铺名称大全 编辑:程序博客网 时间:2024/06/15 00:58

 NSCharacterSet *whitespace = [NSCharacterSetwhitespaceAndNewlineCharacterSet];

  NSString * stringStr = [self.titleField.textstringByTrimmingCharactersInSet:whitespace];//stringStr为self.titleField.text去掉空格后的字符串

  NSLog(@"去除空格之后的标题%@",stringStr);

0 0
原创粉丝点击