Inside Coldfusion MX

"-->

Compare (string1, string2)

Description

Performs a case-sensitive comparison of two strings. Returns the following:

  • 1, if string1 is less than string2

  • 0, if string1 is equal to string2

  • 1, if string1 is greater than string2

Example

<cfoutput> Compare dogs and Dogs: #compare('dogs', 'Dogs')# Compare bunnies and bunnies: #compare('bunnies', 'bunnies')# Compare dogs and bunnies: #compare('dogs', 'bunnies')# </cfoutput>

Категории