contents   index   previous   next



Clib.strncmp()

syntax:

Clib.strncmp(str1, str2, maxLen)

where:

str1 - first string to compare.

 

str2 - second string to compare

 

maxLen - maximum number of characters to use for comparison.

 

return:

number - negative, zero, or positive according to the following rules:

 

< 0 if str1 is less than str2

= 0 if str1 is the same as str2

> 0 if str1 is greater than str2

description:

This method compares up to maxLen bytes of str1 against str2 until there is a mismatch or the terminating null byte is reached. The comparison is case-sensitive. The comparison ends when maxLen bytes have been compared or when a terminating null byte has been compared, whichever comes first.

 

see:

Clib.strncmpi(), Clib.strnicmp(), ==, ===

 

 


Clib.strncmpi()