strCmp Function

Compares two text strings. The function is case-sensitive.


int strCmp(str text1, str text2)

Parameter

Description

text1

The first string.

text2

The string to be compared with the first string.

0 if the two strings are identical, 1 if the first string is longer, or -1 if the second string is longer.

// 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: