1. 一般分割字符串的函数

 sscanf strtok strsep(仅在Linux环境下可运行)

sscanf的默认分隔符:\r \t \n whitespace

2. 可处理带有连续分隔符的函数

 strsep(仅在Linux环境下可运行)

介绍:https://www.cnblogs.com/devilmaycry812839668/p/6353912.html

     https://ixyzero.com/blog/archives/2848.html

第二种方法:strpbrk函数

 https://stackoverflow.com/questions/42315585/split-string-into-tokens-in-c-when-there-are-2-delimiters-in-a-row

posted on 2021-04-25 20:11  clayyjh  阅读(897)  评论(0)    收藏  举报