strCmp Function

Compares two text strings.


int strCmp(str text1, str text2)

Parameter

Description

text1

The first string.

text2

The second string.

0 if the two strings are identical, 1 if the first string sorts earlier, or -1 if the second string sorts earlier.

The comparison performed by this method is case-sensitive.

// Returns 0.
print strCmp("abc", "abc"); 
 
// Returns 1.
print strCmp("abc", "ABC"); 
 
// Returns -1.
print strCmp("aaa", "bbb"); 
 
// Returns 1.
print strCmp("ccc", "bbb"); 

Community Additions

ADD
Show: