读书人

怎么判断quot;中国人quot;里面包含quot;中国quot;解决立

发布时间: 2012-02-11 09:51:34 作者: rapoo

如何判断"中国人"里面包含"中国"?解决立马送分!|
环境vc6

[解决办法]

CString::Find
int Find( LPCTSTR lpszSub ) const;

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.

CStringstr1 = _T( "中国人 ");
CString str1 = _T( "中国 ");
if (str.Find(str1)> 0) 就包含 返回值等于 -1 不包含



[解决办法]
CString的Find()
[解决办法]
上面都说了方法了,以前做过,是对的
[解决办法]
find() != -1

读书人网 >VC/MFC

热点推荐