请问C++的字符串find()函数的用法?
来源:百度知道 编辑:UC知道 时间:2024/05/22 18:57:24
不是很难的东西,不用翻译了吧,From MSDN:
CString::Find
int Find( TCHAR ch ) const;
int Find( LPCTSTR lpszSub ) const;
int Find( TCHAR ch, int nStart ) const;
int Find( LPCTSTR pstr, int nStart ) 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.
Parameters
ch
A single character to search for.
lpszSub
A substring to search for.
nStart
The index of the character in the string to begin the search with, or 0 to start from the beginning. The character at nStart is excluded from the search if nStart is not equal to 0.
pstr
A pointer to a string to search for.
Remarks
Searches this string for the first match of a substring. The function is overloaded to accept both single characters (simi