- (BOOL)isPureNumandCharacters:(NSString *)string
{
string = [string stringByTrimmingCharactersInSet:[NSCharacterSet decimalDigitCharacterSet]];
if(string.length > 0)
{
return NO;
}
return YES;
}
// 判断是否为纯字母
-(BOOL)PureLetters:(NSString*)str{
for(int i=0;i
unichar c=[str characterAtIndex:i];
if((c<'A'||c>'Z')&&(c<'a'||c>'z'))
return NO;
}
return YES;
}
// 判断是否为纯符号
-(BOOL)isIncludeSpecialCharact: (NSString *)str {
str = [str stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString: @"-/:;()¥&@\".,?!'"]];
if(str.length > 0)
{
return NO;
}
return YES;
}
网友评论