C 언어

strcspn

SpeeDr00t 2016. 7. 9. 01:11
반응형

size_t strcspn(const char *s1, const char *s2)


size_t strcspn(const char *s1, const char *s2)
{
    size_t ret=0;
    while(*s1)
        if(strchr(s2,*s1))
            return ret;
        else
            s1++,ret++;
    return ret;
}
반응형