Created
August 21, 2011 00:42
-
-
Save randy-johnson/1159904 to your computer and use it in GitHub Desktop.
Using the EQ Operator to Compare Strings in Coldfusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
Title: String Comparison Using the EQ Operator. | |
From: Coldfusion By Example | |
Website: http://www.randy.cc/ | |
Date: 8/20/2011 | |
---> | |
<!--- Set variables for testing ---> | |
<cfset string1 = "Randy"> | |
<cfset string2 = "RANDY"> | |
<cfset string3 = "Johnson"> | |
<cfoutput> | |
<!--- EQ: Case Insensitive ---> | |
<p> | |
<cfif string1 EQ string2> | |
"#string1#" is equal to "#String2#" | |
<cfelse> | |
"#String1#" is not equal to #string2# | |
</cfif> | |
</p> | |
<p> | |
<cfif string1 EQ string3> | |
"#string1#" is equal to "#String3#" | |
<cfelse> | |
"#String1#" is not equal to #string3# | |
</cfif> | |
</p> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment