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 Comparison Operators
CString                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  BOOL operator ==( const CString& s1, const CString& s2 );
  BOOL operator ==( const CString& s1, const char* s2 );
  BOOL operator ==( const char* s1, const CString& s2 );
  BOOL operator !=( const CString& s1, const CString& s2 );
  BOOL operator !=( const CString& s1, const char* s2 );
  BOOL operator !=( const char* s1, const CString& s2 );
  BOOL operator <( const CString& s1, const CString& s2 );
  BOOL operator <( const CString& s1, const char* s2 );
  BOOL operator <( const char* s1, const CString& s2 );
  BOOL operator >( const CString& s1, const CString& s2 );
  BOOL operator >( const CString& s1, const char* s2 );
  BOOL operator >( const char* s1, const CString& s2 );
  BOOL operator <=( const CString& s1, const CString& s2 );
  BOOL operator <=( const CString& s1, const char* s2 );
  BOOL operator <=( const char* s1, const CString& s2 );
  BOOL operator >=( const CString& s1, const CString& s2 );
  BOOL operator >=( const CString& s1, const char* s2 );
  BOOL operator >=( const char* s1, const CString& s2 ) ;
 
  Remarks
 
  These comparison operators compare two CString objects, and they compare
  a CString object with an ordinary null-terminated C string. The
  operators are a convenient substitute for the case-sensitive Compare
  member function.
 
  Return Value
 
  TRUE if the strings meet the comparison condition; otherwise FALSE.
 
  Example
 
  CString s1( "abc" );
  CString s2( "abd" );
  ASSERT( s1 < s2 ); // Operator is overloaded for both
  ASSERT( "ABC" < s1 ); // CString and char*
  ASSERT( s2 > "abe" );
 
 
 
                                     -♦-