搜索
查看: 2189|回复: 1

查找一个字符串中是否包含某个字符的函数?

[复制链接]
发表于 2007-2-11 16:58:32 | 显示全部楼层 |阅读模式 来自 中国–北京–北京–海淀区
比如说想查找在string[]中是否包含字母a,如果包含返回true,错误返回false的,有没有这个函数?

我觉得应该有吧。
发表于 2007-2-11 18:43:37 | 显示全部楼层 来自 中国–广东–深圳–罗湖区

回复: 查找一个字符串中是否包含某个字符的函数?

// 当不包涵指定的字串时,返回 -1,(区分大小写)
/* Checks if source contains string. On success function
* returns position in source, on failure returns -1. */
native contain(const source[],const string[]);

// 当不包涵指定的字串时,返回 -1,(不区分大小写)
/* Checks if source contains string with case ignoring. On success function
* returns position in source, on failure returns -1. */
native containi(const source[],const string[]);

查看 string.inc 说明
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表