如何编程判断字符串A是否是字符串B的一部分 MFC中如何编程判断字符串A是否是字符串B的一部分并取得字符串B中首次出现字符串A的位置 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CString s( "abcdef" );ASSERT( s.Find( 'c' ) == 2 );ASSERT( s.Find( "de" ) == 3 );// Second example demonstrating // CString::Find( TCHAR ch, int nStart )CString str("The stars are aligned");int n = str.Find('e', 5);ASSERT(n == 12); CString strA = "cde", strB = "abcdef"; int nIndex = 0; if( (nIndex = strB.Find(strA)) != -1) { CString strTemp; strTemp.Format("%d", nIndex); AfxMessageBox(strTemp); } 刚学数据库,MFC应用程序无法连接到数据库问题 谁帮了我,我以身相许!!!MY 航空管理 关于背面拣选的问题 菜鸟请教CFileFind类问题,大侠们帮帮忙 cjlibrary的使用问题 这样的字符串怎么写? 那能下载vc6。0 200分可以讲价 在线洽谈 关于ICMP校验和计算的问题:长度非偶字节怎么办? 请教CDateTimeCtrl控件问题!第4次了! 哪里可以下载MASM 6.11 c 及以后的版本,谢谢,20分 为什么关闭Recordset会出错? 请问如何截获windows所发出的所有http请求?并取得访问的网址
ASSERT( s.Find( 'c' ) == 2 );
ASSERT( s.Find( "de" ) == 3 );// Second example demonstrating
// CString::Find( TCHAR ch, int nStart )
CString str("The stars are aligned");
int n = str.Find('e', 5);
ASSERT(n == 12);
int nIndex = 0;
if( (nIndex = strB.Find(strA)) != -1)
{
CString strTemp;
strTemp.Format("%d", nIndex);
AfxMessageBox(strTemp);
}