Skip to content

Latest commit

 

History

History
121 lines (104 loc) · 6.56 KB

strnicoll-wcsnicoll-mbsnicoll-strnicoll-l-wcsnicoll-l-mbsnicoll-l.md

File metadata and controls

121 lines (104 loc) · 6.56 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic apiname apilocation apitype f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
_strnicoll, _wcsnicoll, _mbsnicoll, _strnicoll_l, _wcsnicoll_l, _mbsnicoll_l | Microsoft Docs
11/04/2016
cpp-standard-libraries
article
_mbsnicoll_l
_mbsnicoll
_wcsnicoll_l
_strnicoll
_strnicoll_l
_wcsnicoll
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-multibyte-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
DLLExport
wcshicoll_l
_ftcsncicoll
strnicoll_l
_wcsnicoll
mbsnicoll_l
_strnicoll
mbsnicoll
_ftcsnicoll
wcsnicoll
_tcsnicoll
_mbsnicoll
strinicoll
_tcsncicoll
C++
code pages, using for string comparisons
ftcsncicoll function
mbsnicoll_l function
_ftcsnicoll function
mbsnicoll function
_tcsnicoll function
_wcsnicoll_l function
_mbsnicoll function
tcsncicoll function
strnicoll function
_ftcsncicoll function
wcsnicoll_l function
_mbsnicoll_l function
_tcsncicoll function
strnicoll_l function
wcsnicoll function
_strnicoll_l function
_wcsnicoll function
ftcsnicoll function
strings [C++], comparing by code page
tcsnicoll function
_strnicoll function
abf0c569-725b-428d-9ff2-924f430104b4
21
corob-msft
corob
ghogen

_strnicoll, _wcsnicoll, _mbsnicoll, _strnicoll_l, _wcsnicoll_l, _mbsnicoll_l

Compares strings by using locale-specific information.

Important

_mbsnicoll and _mbsnicoll_l cannot be used in applications that execute in the Windows Runtime. For more information, see CRT functions not supported with /ZW.

Syntax

int _strnicoll(  
   const char *string1,  
   const char *string2,  
   size_t count   
);  
int _wcsnicoll(  
   const wchar_t *string1,  
   const wchar_t *string2 ,  
   size_t count   
);  
int _mbsnicoll(  
   const unsigned char *string1,  
   const unsigned char *string2,  
   size_t count   
);  
int _strnicoll_l(  
   const char *string1,  
   const char *string2,  
   size_t count,  
   _locale_t locale  
);  
int _wcsnicoll_l(  
   const wchar_t *string1,  
   const wchar_t *string2 ,  
   size_t count,  
   _locale_t locale  
);  
int _mbsnicoll_l(  
   const unsigned char *string1,  
   const unsigned char *string2,  
   size_t count,  
   _locale_t locale  
);  

Parameters

string1, string2
Null-terminated strings to compare

count
Number of characters to compare

locale
The locale to use.

Return Value

Each of these functions returns a value indicating the relationship of the substrings of string1 and 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. _wcsnicoll can fail if either string1 or string2 contains wide-character codes outside the domain of the collating sequence. When an error occurs, _wcsnicoll may set errno to EINVAL. To check for an error on a call to _wcsnicoll, set errno to 0 and then check errno after calling _wcsnicoll.

Remarks

Each of these functions performs a case-insensitive comparison of the first count characters in string1 and string2 according to the code page. These functions should be used only when there is a difference between the character set order and the lexicographic character order in the code page and this difference is of interest for the string comparison. The versions of these functions without the _l suffix use the current locale and code page. The versions with the _l suffix are identical except that they use the locale passed in instead. For more information, see Locale.

All of these functions validate their parameters. If either string1 or string2 is a null pointer, or if count is greater than INT_MAX, the invalid parameter handler is invoked, as described in Parameter Validation . If execution is allowed to continue, these functions return _NLSCMPERROR and set errno to EINVAL.

Generic-Text Routine Mappings

TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined
_tcsncicoll _strnicoll _mbsnbicoll _wcsnicoll
_tcsnicoll _strnicoll _mbsnbicoll _wcsnicoll
_tcsnicoll_l _strnicoll_l _mbsnbicoll_l _wcsnicoll_l

Requirements

Routine Required header
_strnicoll, _strnicoll_l <string.h>
_wcsnicoll, _wcsnicoll_l <wchar.h> or <string.h>
_mbsnicoll, _mbsnicoll_l <mbstring.h>

For additional compatibility information, see Compatibility.

See Also

Locale
String Manipulation
strcoll Functions
localeconv
_mbsnbcoll, _mbsnbcoll_l, _mbsnbicoll, _mbsnbicoll_l
setlocale, _wsetlocale
strcmp, wcscmp, _mbscmp
_stricmp, _wcsicmp, _mbsicmp, _stricmp_l, _wcsicmp_l, _mbsicmp_l
strncmp, wcsncmp, _mbsncmp, _mbsncmp_l
_strnicmp, _wcsnicmp, _mbsnicmp, _strnicmp_l, _wcsnicmp_l, _mbsnicmp_l
strxfrm, wcsxfrm, _strxfrm_l, _wcsxfrm_l