标签:
http://blog.sina.com.cn/s/blog_7ee076050102vamg.html
#include <stdio.h> #include <string.h> int main(int argc,char **argv) { char buf1[]="aaa, ,a,,,,bbb-c, , ,ee|abc";//必须为[],即字符串为有名字符串,而非匿名字符串 char* token = strtok( buf1, ",-| "); while( token != NULL ) { printf("%s", token ); token = strtok( NULL, ",-|"); } printf("\n"); return 0; } OUT 值: aaa abbbc eeabc
标签:
原文地址:http://www.cnblogs.com/qmfsun/p/4925583.html