jinyedge's note
{http://www.jinyedge.pe.kr}


Hi, this is jinyedge. I'm a software developer. I hope you can find some useful information in my homepage.


jinyedge at gmail.com
Since 2001.12.05

 

 
Subj Cont
 
Subj: C, Using strspn.
Mtime: 2009-09-05 00:51:19

#include <stdio.h>
#include <string.h>
int main(){
    char* line = "12,2,45";

    // with comma.
    printf("%d, %d\n", strlen(line), strspn(line, "0123456789,"));

    // without comma.
    printf("%d, %d\n", strlen(line), strspn(line, "0123456789"));

    return 0;
}