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

compare(string1, string2) → returns Numeric

Argument Reference for the compare function


Required: Yes


Required: Yes

Examples sample code invoking the compare function

Tag Syntax

<cfset comparison = compare('ColdFusion', 'coldfusion')> 
 <cfdump var="#comparison#" />     

Expected Result: -1

Fork me on GitHub