Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do these two strings equal each other? 3

Status
Not open for further replies.

KevinFSI

Programmer
Nov 17, 2000
582
US
Code:
<cfset varA = "018-009">
<cfset varB = "009-018">

<cfif varA IS varB>true<cfelse>false</cfif>

The above resolves to true.

 
wish i knew

however, <cfif Evaluate(varA) IS Evaluate(varB)>true<cfelse>false</cfif>

produces false

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
From what I can tell, the strings are being converted to dates. Both are interpreted as September 18 2013, which is why the comparison resolves to true. If you want to ensure a string comparison, use compare() or compareNoCase() instead.




----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top