呵呵:MSDN:的秒速如图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.也就是基于下标为0的的查找;第一个是查找的字符,第二个是查找的开始位置;返回的是字符串的位置,...
一、CString之Find()、FindOneOf()、ReverseFind() 此三个函数返回值均为整数int。 1、Find() 该函数从左侧0索引开始,查找第一个出现的字符位置,返回position。示例如下: 1CString s("abcd"); 2ASSERT( s.Find('b') == 1 ); 返回值: 如果查到,返回以0索引起始的位置 未查到,返回-1 2、FindOneOf(...
一、CString之Find()、FindOneOf()、ReverseFind()。此三个函数返回值均为整数int。 1、Find() 该函数从最左侧0位置开始索引,查找到第一个出现该字符的位置,返回position。示例如下: CString s( "abcabc" ); ASSERT( s.Find( 'b' ) == 1 ); int f = s.Find( "de" ) ; // 结果 f = 3 返回...
CString::Find Article 07/12/2006 intFind(TCHARch**)const;** intFind(LPCTSTRlpszSub**)const;** int Find( TCHARch**, int**nStart) const; int Find( LPCTSTRpstr**, int**nStart) const; Return Value The zero-based index of the first character in thisCStringobject that matches the request...
CString::Find Article 07/12/2006 intFind(TCHARch**)const;** intFind(LPCTSTRlpszSub**)const;** int Find( TCHARch**, int**nStart) const; int Find( LPCTSTRpstr**, int**nStart) const; Return Value The zero-based index of the first character in thisCStringobject that matches the request...
括号里边的是中文逗号。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.我...
Using the CString::Find( character, start ) form of the function. If I am reading the documentation correctly, there's no way to skip past a character that is the first position in the string. For example, if the string is "aacda", and you search for ( 'a', 0 ), you'll find...
The zero-based index of the first character in thisCStringobject that matches the requested substring or characters; -1 if the substring or character is not found. Example // First example demonstrating // CString::Find (TCHAR ch) CString s("abcdef"); ASSERT(s.Find('c') == 2); ASSERT...
不是很难的东西,不用翻译了吧,From MSDN: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 ...
#include<cstring> #include<cstdio> #include<iostream> using namespace std; int main() { find函数返回类型 size_type string s("1a2b3c4d5e6f7jkg8h9i1a2b3c4d5e6f7g8ha9i"); string flag; string::size_type position; //find 函数 返回jk 在s 中的下标位置 position = s.find("jk"); if...