Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CString::Find
CString                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  int Find( char ch ) const;
  int Find( const char* pszSub ) const;
 
  Parameter   Description
 
  <ch>        A single character to search for.
 
  <pszSub>    A substring to search for.
 
  Remarks
 
  Searches this string for the first match of a substring. The function is
  overloaded to accept both single characters (similar to the run-time
  function strchr) and strings (similar to strstr).
 
  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.
 
  Example
 
  CString s( "abcdef" );
  ASSERT( s.Find( 'c' ) == 2 );
  ASSERT( s.Find( "de" ) == 3);
 
 
  See Also
 
  CString::ReverseFind, CString::FindOneOf
 
 
                                     -♦-