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 ) ;
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.
TRUE if the strings meet the comparison condition; otherwise FALSE.
CString s1( "abc" );
CString s2( "abd" );
ASSERT( s1 < s2 ); // Operator is overloaded for both
ASSERT( "ABC" < s1 ); // CString and char*
ASSERT( s2 > "abe" );