我想查找实现这样的功能,给定"abcde.......xyz", 查找字符串str中与"abc"任意字符匹配的字符位置,然后再从此位置继续寻找,如此循环CString中有FindOneOf函数可以实现任意字符的查找,但是无法从指定位置查找,需要重新处理字符串。而string类里有find_first_of这样的函数,不仅可以实现这样的功能,还可以从指定的位置查找。
CString里面为什么没有这样的函数呢?感觉CString应该会涵盖string类里的绝大多数功能的。各位帮忙看看,谢谢!
CString里面为什么没有这样的函数呢?感觉CString应该会涵盖string类里的绝大多数功能的。各位帮忙看看,谢谢!
Return Value
The zero-based index of the first character in this CString object that matches the requested substring or characters; -1 if the substring or character is not found
截取右边的自字符串 ...所以,
你可以不断的 FindOneOf 然后把左边的字符串截断,
只留下右边的未查找部分,
然后继续 FindOneOf ....
然后使用字符串定位指针
strstr
strchr