CString::Left CString Left( int nCount ) const; throw( CMemoryException ); 返回的字符串是前nCount个字符。 例子 CString s( _T("abcdef") ); ASSERT( s.Left(2) == _T("ab") ); CString::LoadString BOOL LoadString( UINTnID); throw( CMemoryException ); 返回值 如果加载资源成功则返回非...
你查找的这个分号是英文的,看看你字符串strTab1中的分号是不是也是英文的分号,如果不是,就改成一样的格式的就行了
CString——Left、Right、Find、ReverseFind CString——Left、Right、Find、ReverseFind CString::Left(intnCount) ——返回字符串前nCount个字符的字符串 example: CString str(_T(“Shop,车间”)); str = str.Left(4); 结果:str=”Shop”; CString::Right(int nCount) ——返回字符串后nCount个字符的字符...
CString str=_T("Microsoft Window7");str=str.Left(str.GetLength()-1); //str="Microsoft Window"
CString Left( int nCount ) const; 从左边取nCount个字符,当nCount=-1或0时,返回“”,如果nCount超过了字符串长度,则提取整个字符串。 CString Right( int nCount ) const;从右边取nCount个字符 CString Mid( int nFirst ) const; 从nFirst位置到结尾 [nFirst, -1) ...
int i = str.Find('?');str.Left(i);或者为了避免从左查找可能有多个?,使用如下的从右查找函数。int i = str.ReverseFind('?');str.Left(i);
delete是删除 left是取左 如下例子:CString str1,str2;str1 = _T("abcdefg123456");str1.Delete(0,7);//0表示起始位置,7表示要删除的字符数 此时 str1 = _T("123456");str2 = str1.Left(3);//str2 = _T("123"); str1 = _T("123456");
ASSERT( s.Left(2) == _T("ab") ); 3.CString::LoadString BOOL LoadString( UINT nID ); throw( CMemoryException ); 返回值:如果加载资源成功则返回非零值;否则返回0。 nID 一个Windows 字符串资源ID。 说明: 此成员函数用来读取一个由nID 标识的Windows 字符串资源,并放入一个已有CString 对象中。
提取字符串子串有Left(), Right(), Mid()方法,如CString str2 = str1.Left(3);提取前3个字符,Mid()可以指定起始索引和长度,如CString str2 = str1.Mid(1, 3);获取索引1开始的3个字符。查找操作包含Find(), FindOneOf(), 和ReverseFind(),如int nIndex1 = str.Find(_T("zh"));...
首先,这个是毫米值并且已经超出了long的范围,你需要将它转换为秒(/1000)time_t t = 1339934037;CTime ct(t);CString m_edit1 = ct.Format("%Y-%m-%d %H:%M:%S");