Share via


CString::CompareNoCase

int CompareNoCase( LPCTSTRlpsz**) const;**

Return Value

Zero if the strings are identical (ignoring case), <0 if this CString object is less than lpsz (ignoring case), or >0 if this CString object is greater than lpsz (ignoring case).

Remarks

Compares this CString object with another string using the generic-text function _tcsicmp. The generic-text function _tcsicmp, which is defined in TCHAR.H, maps to either _stricmp, _wcsicmp, _mbsicmp depending on the character set that is defined at compile time. Each of these functions performs a case-insensitive comparison of the strings, and is not affected by locale. For more information, see in the Run-Time Library Reference.

Example

The following example demonstrates the use of CString::CompareNoCase.

// example for CString::CompareNoCase
CString s1( "abc" );
CString s2( "ABD" );
ASSERT( s1.CompareNoCase( s2 ) == -1 ); // Compare with a CString.
ASSERT( s1.Compare( "ABE" ) == -1 ); // Compare with LPTSTR string.

CString OverviewClass MembersHierarchy Chart

See Also   CString::Compare, CString::Collate, CString::CollateNoCase