分解一个字符串

支持芯片: SHMICTRL系列芯片 ESP32-S3系列

str explode_str(str s,str sub,int n);
//s: 原字符串
//sub:搜索子串,只有第一个字符有效
//n:获取分解后的第几个字符串,0开始

示例

str ss="1234|5678|9012|3456";
str s;
s=explode_str(ss,"|",0);//1234
s=explode_str(ss,"|",1);//5678

ss="http://www.shmictrl.com/abc/";
s=explode_str(ss,"/",2);//www.shmictrl.com

注意