标签:io os ar sp strong div on 问题 bs
NSCharacterSet *errorCharStr = [NSCharacterSet
characterSetWithCharactersInString:@"~!@#$%^&*+?/="];
NSRange range = (NSRange){65535,0};
range = [str rangeOfCharacterFromSet:errorCharStr];
if (range.length > 0) {
return YES;
}
如果range的length属性大于 0,则说明字符串里含有非法字符。
标签:io os ar sp strong div on 问题 bs
原文地址:http://www.cnblogs.com/ndyBlog/p/4057470.html