The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

strcasecmp, strncasecmp - case-insensitive string comparisons

 SYNOPSIS



#include <strings.h>

int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);

 DESCRIPTION

The strcasecmp() function compares, while ignoring differences in case, the string pointed to by s1 to the string pointed to by s2. The strncasecmp() function compares, 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() do upper to lower conversions, then a byte comparison. The results are unspecified in other locales.

 RETURN VALUE

Upon completion, strcasecmp() returns 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() returns 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.

 FUTURE DIRECTIONS

None.

 SEE ALSO

<strings.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]