Compartilhar via


_stricoll, _wcsicoll, _mbsicoll

Compare strings using locale-specific information.

int_stricoll(constchar*string1,constchar*string2);

int_wcsicoll(constwchar_t*string1,constwchar_t*string2);

int_mbsicoll( constunsignedchar *string1**,constunsignedchar** *string2 );

Routine Required Header Compatibility
_stricoll <string.h> Win 95, Win NT
_wcsicoll <wchar.h>, <string.h> Win 95, Win NT
_mbsicoll <mbstring.h> Win 95, Win NT

For additional compatibility information, see Compatibility in the Introduction.

Libraries

LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version

Return Value

Each of these functions returns a value indicating the relationship of string1 to string2, as follows.

Return Value Relationship of string1 to string2
< 0 string1 less than string2
0 string1 identical to string2
> 0 string1 greater than string2

Each of these functions returns _NLSCMPERROR. To use _NLSCMPERROR, include either STRING.H or MBSTRING.H. _wcsicoll can fail if either string1 or string2 contains wide-character codes outside the domain of the collating sequence. When an error occurs, _wcsicoll may set errno to EINVAL. To check for an error on a call to _wcsicoll, set errno to 0 and then check errno after calling _wcsicoll.

Parameters

string1, string2

Null-terminated strings to compare

Remarks

Each of these functions performs a case-insensitive comparison of string1 and string2 according to the code page currently in use. These functions should be used only when there is a difference between the character set order and the lexicographic character order in the current code page and this difference is of interest for the string comparison.

Generic-Text Routine Mappings

TCHAR.H Routine _UNICODE & _MBCS Not Defined _MBCS Defined _UNICODE Defined
_tcsicoll _stricoll _mbsicoll _wcsicoll

Locale Routines, String Manipulation Routinesstrcoll Functions Overview

See Also   localeconv, _mbsnbcoll, setlocale, strcmp, _stricmp, strncmp, _strnicmp, strxfrm