![MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference Download Page 319](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-cfml-language/coldfusion-4-5-cfml-language_reference_3287257319.webp)
Chapter 2: ColdFusion Functions
295
CompareNoCase
Performs a case-insensitive comparison of two strings. Returns a negative number if
string1 is less than string2; 0 if string1 is equal to string2; or a positive number if string1
is greater than string2.
See also
Compare
and
FindNoCase
.
Syntax
CompareNoCase
(
string1, string2)
string1, string2
Strings to be compared.
Examples
<!--- This example shows the use of CompareNoCase --->
<HTML>
<HEAD>
<TITLE>
CompareNoCase Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>CompareNoCase Example</H3>
<P>The compare function performs a <I>case-insensitive</I>
comparison of two strings.
<CFIF IsDefined("FORM.string1")>
<CFSET comparison = CompareNoCase(FORM.string1, FORM.string2)>
<!--- switch on the variable to give various responses --->
<CFSWITCH EXPRESSION=#comparison#>
<CFCASE VALUE="-1">
<H3>String 1 is less than String 2</H3>
<I>The strings are not equal</I>
</CFCASE>
<CFCASE VALUE="0">
<H3>String 1 is equal to String 2</H3>
<I>The strings are equal!</I>
</CFCASE>
<CFCASE VALUE="1">
<H3>String 1 is greater than String 2</H3>
<I>The strings are not equal</I>
</CFCASE>
<CFDEFAULTCASE>
<H3>This is the default case</H3>
...
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...