(IOS)判断字符串首字符是否为字母
2018-12-26 本文已影响0人
rightmost
+(BOOL)JudgeString:(NSString *)string{
NSString *regex =@"[A-Za-z]+";
NSPredicate*predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
return[predicate evaluateWithObject:string];
}