替换字符串

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

str strreplace(str s,str sub,str rep); 
//s: 主字符串,被查找的字符串
//sub: 查询的字符串,老字符串
//rep: 替换的字符串,新字符串
//把老字符串替换成新字符串
//返回:替换后的字符串;

示例

str s="hello 中国";
s=strreplace(s,"中国","world");
echo (s);

注意