int Find( LPCTSTR lpszSub, int nStart ) const; 返回值 不匹配的话返回 -1; 索引以0 开始 nStar 代表以索引值nStart 的字符开始搜索 , 即为包含以索引nStart字符后的字符串 例子 CString s( “abcdef” ); ASSERT( s.Find( ‘c’ ) == 2 ); ASSERT( s.Find( “de” ) == 3 ); Cstring ...
CString::Find int Find( TCHAR ch ) const; int Find( LPCTSTR lpszSub ) const; int Find( TCHAR ch, int nStart ) const; int Find( LPCTSTR lpszSub, int nStart ) const; 返回值 不匹配的话返回 -1; 索引以0 开始 nStar 代表以索引值nStart 的字符开始搜索 , 即为包含以索引nStart字符后的字...
CString s( "abcdef" ); ASSERT( s.Find( 'c' ) == 2 ); ASSERT( s.Find( "de" ) == 3 );
CString::Find int Find( TCHAR ch ) const; int Find( LPCTSTR lpszSub ) const; int Find( TCHAR ch, int nStart ) const; int Find( LPCTSTR lpszSub, int nStart ) const; 返回值 不匹配的话返回 -1; 索引以0 开始 nStar 代表以索引值nStart 的字符开始搜索 , 即为包含以索引nStart字符后的字...
Return Value:The index of the last character in this CString object that matches the requested character; –1 if the character is not found.Parameters:ch The character to search for.Remarks:Searches this CString object for the last match of a substring. The function is similar to...
括号里边的是中文逗号。if( string.Find(",") == -1) AfxMessageBox(" comma is found.");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.我...
CString::Findint Find( TCHAR ch ) const;int Find( LPCTSTR lpszSub ) const;int Find( TCHAR ch**, int** nStart ) const;int Find( LPCTSTR pstr**, int** nStart ) const;Return ValueThe zero-based index of the first character in this CString object that matches the requested substring ...
#include <iostream>#include <cstring>using namespace std;char *strCat(char *dest,const char *src){char *p=dest;while (*dest) *dest++; //与strCpy比只多此行,目标串指针移到尾部然后复制源串while ((*dest++ = *src++)!='\0');return p;}char *strnCat(char *dest,const char *src,int ...
CString str1 = _T("abccdefgh123");intnIndexch = str1.Find('c');// nIndexch = 2;nIndexch = str1.Find('c',3);// nIndexch = 3;intnIndexSubStr = str1.Find(_T("fgh"));// nIndexSubStr = 6;nIndexSubStr = str1.Find(_T("fgdh"));// nIndexSubStr = -1; ...
不找了,自己写吧。CString里面有Find,然后再组成数组。void Split(CString source, CStringArray& dest, CString division)...{ dest.RemoveAll();int pos = 0;int pre_pos = 0;while( -1 != pos )...{ pre_pos = pos;pos = source.Find(division,(pos+1));dest.Add(source.Mid(pre...