Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining


Compares two strings (case insensitive).

int CompareNoCase(
   PCXSTR psz
) const throw();


The other string used for comparison.

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

The generic-text function _tcsicmp, which is defined in TCHAR.H, maps to either _stricmp, _wcsicmp or _mbsicmp, depending on the character set that is defined at compile time. Each function performs a case-insensitive comparison of the strings. The comparison depends on the LC_CTYPE aspect of the locale but not LC_COLLATE. For more information, see _stricmp, _wcsicmp, _mbsicmp, _stricmp_l, _wcsicmp_l, _mbsicmp_l.

// typedef CStringT<TCHAR, StrTraitATL<TCHAR, ChTraitsCRT<TCHAR>>> CAtlString;

CAtlString s1(_T("abc"));
CAtlString s2(_T("ABD"));
ASSERT(s1.CompareNoCase(s2) < 0); // Compare with a CAtlString.
ASSERT(s1.CompareNoCase(_T("ABE")) < 0); // Compare with LPTSTR string.   

Header: cstringt.h

Community Additions

© 2015 Microsoft