[b][red]This message was edited by tokoG at 2006-3-30 23:34:2[/red][/b][hr]
I came accross the new string function, strspn and checked what it does.
This site had pretty good explanation http://www.cplusplus.com/ref/cstring/strspn.html
but, all in all, I think what it does is return the number(length) of what it matches to the other string.
[b]In here, strtext & cset both contains 1 & 2 & 9, that's why the return is [red]3[/red]. Am I right?[b]
/* strspn example */#include #include
int main ()
char strtext = "129th";
char cset = "1234567890";
i = strspn (strtext,cset);
printf ("Length of initial number is %d
Length of initial number is 3
I don't know how this could be useful..?