Siebel eScript Language Reference > Siebel eScript Commands > The Clib Object String Methods >

Clib.strncmp() Method


This method makes a case-sensitive comparison of two strings up to a specified number of bytes until there is a mismatch or it reaches the end of a string.

Syntax

Clib.strncmp(string1, string2, maxLen)

Parameter
Description

string1

A string, or a variable containing a string, to be compared with string2

string2

A string, or a variable containing a string, to be compared with string1

maxLen

The number of bytes to compare

Returns

The result of the comparison, which is 0 if the strings are identical, a negative number if the ASCII code of the first unmatched character in string1 is less than that of the first unmatched character in string2, or a positive number if the ASCII code of the first unmatched character in string1 is greater than that of the first unmatched character in string2.

Usage

This method compares up to maxLen bytes of string1 against string2 until there is a mismatch or it reaches the end of a string. The comparison is case sensitive. The comparison ends when maxLen bytes have been compared or when a terminating null byte has been reached, whichever comes first.

See Also

Clib.stricmp() Method and Clib.strcmpi() Method
Clib.strncmpi() Method and Clib.strnicmp() Method

Siebel eScript Language Reference