Chinaunix首页 | 论坛 | 博客
  • 博客访问: 306996
  • 博文数量: 53
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 325
  • 用 户 组: 普通用户
  • 注册时间: 2013-10-14 22:50
文章分类

全部博文(53)

文章存档

2014年(15)

2013年(38)

我的朋友

分类: iOS平台

2013-11-12 20:53:22

去除两端空格

NSString *temp = [textField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];


去除两端空格和回车

NSString *text = [temp stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet ]];
阅读(381) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~