查找字符串

int strpos(str s,str substr);
//s: 主字符串,被查找的字符串
//substr: 查询的字符串
//返回:子字符串的位置(0开始),查不到返回-1;

示例

int i;
str s="hello 中国";
i=strpos(s,"美国");  //-1
i=strpos(s,"中国");  //6
i=strpos(s,"hello");  //0

注意