strcasecmp (original) (raw)

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.

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.

The following sections are informative.

End of informative text.