strcasecmp, strncasecmp - compare two strings ignoring case
#include <strings.h>
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);
The strcasecmp() function performs a byte-by-byte comparison of the strings s1
and s2
, ignoring the case of the characters. It returns an integer less than, equal to, or greater than zero if s1
is found, respectively, to be less than, to match, or be greater than s2
.
The strncasecmp() function is similar, except that it compares no more than n
bytes of s1
and s2
.
The strcasecmp() and strncasecmp() functions return an integer less than, equal to, or greater than zero if s1
is, after ignoring case, found to be less than, to match, or be greater than s2
, respectively.
bcmp(3), memcmp(3), strcmp(3), strcoll(3), string(3), strncmp(3), wcscasecmp(3), wcsncasecmp(3)