standard.C.string.strncmp

strncmp is available since version 1.0.

Prototype:

number strncmp(string string1, string string2, number count)

Parameters

string1
String to compare
string2
String to compare
count
Number of characters to compare

Description:

Compare characters of two strings.The strncmp function lexicographically compares, at most, the first count characters in string1 and string2 and returns a value indicating the relationship between the substrings. strncmp is case-sensitive. Unlike strcoll, strncmp is not affected by locale.

Return value:

Return Value Description < 0 string1 substring less than string2 substring 0 string1 substring identical to string2 substring > 0 string1 substring greater than string2 substring