首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

怎么判断"中国人"里面包含"中国"解决立马送分!|

2012-02-11 
如何判断中国人里面包含中国?解决立马送分!|环境vc6[解决办法]CString::Findint Find( LPCTSTR lpszSu

如何判断"中国人"里面包含"中国"?解决立马送分!|
环境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

热点排行