[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
删除字符串头尾空白部分;换行,空格等。
<pre name="code" class="objc">[content stringByReplacingOccurrencesOfString:@"\r\n" withString:@""] attributes:ats];
删除所有内容的换行符,空格就不写了。
<pre name="code" class="objc">CFStringTrimWhitespace((CFMutableStringRef)string);
一样是删除所有空白处的函数。