特殊字符过滤

-(BOOL)isIncludeSpecialCharact:(NSString *)str{

    for (int i=0; i<str.length; i++) {

        unichar c = [str characterAtIndex:i];

        if ((c < '0' || c > '9') && (c < 'a' || c > 'z')

            && (c < 'A' || c > 'Z') && (c < 0x4e00 || c > 0x9fa5)) {

            return YES;

        }

    }    

    returnNO;

}

posted @ 2012-07-31 15:18  ValeTu  阅读(228)  评论(0编辑  收藏  举报