NSString *_string = [NSString stringWithFormat:@"123 456"];
NSRange _range = [_string rangeOfString:@" "];
if (_range.location != NSNotFound) {
//有空格
}else {
//没有空格
}
时间: 2024-10-11 18:55:39
NSString *_string = [NSString stringWithFormat:@"123 456"];
NSRange _range = [_string rangeOfString:@" "];
if (_range.location != NSNotFound) {
//有空格
}else {
//没有空格
}