- (BOOL) isBlankString:(NSString *)string {
if (string == nil || string == NULL) {
return YES;
}
if ([string isKindOfClass:[NSNull class]]) {
return YES;
}
if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) {
return YES;
}
return NO;
} //判断roadTitleLab.text 是否含有qingjoin
if([roadTitleLab.text rangeOfString:@"qingjoin"].location !=NSNotFound)//_roaldSearchText
{
NSLog(@"yes");
}
else
{
NSLog(@"no");
}
本文介绍了一个Objective-C中用于检查字符串是否为空或仅包含空白字符的方法,并演示了如何在UILabel中搜索特定文本。

1888

被折叠的 条评论
为什么被折叠?



