#include <string.h>
#include <stdio.h>
int main () {
char str[80] = "This is - www.yiibai.com - website";
const char s[2] = "-";
char *token;
/* get the first token */
token = strtok(str, s);
/* walk through other tokens */
while( token != NULL ) {
printf( " %s/n", token );
token = strtok(NULL, s);
}
return(0);
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/265284.html