Next: c-strcaseeq, Previous: c-ctype, Up: Character and String Functions in C Locale [Contents][Index]
The c-strcase
module contains case-insensitive string comparison
functions operating on single-byte character strings, like the functions in
<strings.h>
, that operate as if the locale encoding was ASCII.
(The "C" locale on many systems has the locale encoding "ASCII".)
The functions are:
extern int c_strcasecmp (const char *s1, const char *s2); extern int c_strncasecmp (const char *s1, const char *s2, size_t n);
For case conversion here, only ASCII characters are considered to be upper case or lower case.
Note: The functions strcasecmp
, strncasecmp
from
<strings.h>
support only unibyte locales; for multibyte locales,
you need the functions mbscasecmp
, mbsncasecmp
,
mbspcasecmp
.