NSString *_string = [NSString stringWithFormat:@"123 456"];
NSRange _range = [_string rangeOfString:@" "];
if (_range.location != NSNotFound) {
//有空格
}else {
//没有空格
}
NSString *_string = [NSString stringWithFormat:@"123 456"];
NSRange _range = [_string rangeOfString:@" "];
if (_range.location != NSNotFound) {
//有空格
}else {
//没有空格
}
转载于:https://www.cnblogs.com/Cheetah-yang/p/4699607.html