Name
strnicmp -- compare string characters case-insensitively (V7.0)
Synopsis
int r = strnicmp(const char *s1, const char *s2, size_t n);
Function
Compares a maximum of n bytes in strings s1 and s2 in a case-insensitive way. If a NULL character is encountered in either string before reaching n bytes, the comparison is stopped. Both strings must be valid UTF-8 strings.

If s1 is less than s2, -1 is returned. If s1 is greater than s2, 1 is returned, otherwise the return value is 0.

Note that n must be specified in bytes, not in characters.

Note that this function is mostly useful for checking the equality of two strings in a case-insensitive way. It is not appropriate for sorting because it currently doesn't handle all intricacies of Unicode collation. If you need to compare strings for sorting, please use hw_CompareString() instead. See hw_CompareString for details.

Designer compatibility
Unsupported

Inputs
s1
first string to compare
s2
second string to compare
n
number of bytes to compare
Results
r
result of comparison (see above)

Show TOC