1:去除空格方法
NSString *str=@"jsd sdjgjg sjdg sg ";
[str stringByReplacingOccurrencesOfString:@" " withString:@""];
2:判断空格方法
NSString *str=@"jsd sdjgjg sjdg sg ";
if ([str rangeOfString:@" "].location==NSNotFound) {
//没有空格走这里
}
1:去除空格方法
NSString *str=@"jsd sdjgjg sjdg sg ";
[str stringByReplacingOccurrencesOfString:@" " withString:@""];
2:判断空格方法
NSString *str=@"jsd sdjgjg sjdg sg ";
if ([str rangeOfString:@" "].location==NSNotFound) {
//没有空格走这里
}