标签:nes char pre space form orm bsp acea 字符串
if ([title hasPrefix:@" "]) {
title = [title stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];//去掉前后空格
}else if([title hasPrefix:@"\n"]){
title = [title stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];//去掉前后回车键
}else{
title = [title stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];//去掉前后空格+回车键
title = [NSString stringWithFormat:@"%@",headLinesModel.title];
}
标签:nes char pre space form orm bsp acea 字符串
原文地址:http://www.cnblogs.com/lrr0618/p/6651413.html