Tags · Functions · Objects
Lucee Function Reference
Choose a function:

Function COMPARE

Performs a case-sensitive comparison of two strings.
-1, if string1 is less than string2
0, if string1 is equal to string2
1, if string1 is greater than string2

Example

compare(string string1,string string2):number

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
string1 string  Yes A string or a variable that contains one  
string2 string  Yes A string or a variable that contains one