NAME
strcasecmp
strncasecmp —
case-insensitive string comparisons
SYNOPSIS
int strcasecmp(const char *s1, const char *s2); int strncasecmp(const char *s1, const char *s2, size_t n);
DESCRIPTION
The strcasecmp () function shall compare,
while ignoring differences in case, the string pointed to by
s1 to the string pointed to by s2. The
strncasecmp () function shall compare, while
ignoring differences in case, not more than
n bytes from the
string pointed to by s1 to the string pointed to by
s2.
In the POSIX locale, strcasecmp () and
strncasecmp () shall behave as if the strings had
been converted to lowercase and then a byte comparison performed. The
results are unspecified in other locales.
RETURN VALUE
Upon completion, strcasecmp () shall
return an integer greater than, equal to, or less than 0, if the string
pointed to by s1 is, ignoring case, greater than, equal
to, or less than the string pointed to by s2,
respectively.
Upon successful completion, strncasecmp ()
shall return an integer greater than, equal to, or less than 0, if the
possibly null-terminated array pointed to by s1 is,
ignoring case, greater than, equal to, or less than the possibly
null-terminated array pointed to by s2, respectively.
ERRORS
No errors are defined.
EXAMPLES
None.
APPLICATION USAGE
None.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
The Base Definitions volume of IEEE Std 1003.1-2001 (“POSIX.1”), <strings.h>
CHANGE HISTORY
First released in Issue 4, Version 2.
Issue 5
Moved from X/OPEN UNIX extension to BASE.
End of informative text. footer end