[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
去掉字符串里的空格
原文:http://5828666.blog.51cto.com/5818666/1661333