Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

check string in c

Name: Anonymous 2009-05-24 9:14

what the fast way to check that string contain only characters within some set like "a-z0-9"?

Name: Anonymous 2009-05-25 10:46

int is_inset(const char *s){
    if(*s=='\0')
        return 1;
    if(*s>='a' && *s<='z' || *s>='0' && *s<='9')
        return is_inset(s+1);
   
    return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List