Comparenocase - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

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
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
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">
</CFCASE>
<CFCASE VALUE="0">
</CFCASE>
<CFCASE VALUE="1">
</CFCASE>
<CFDEFAULTCASE>
...
Compare
and FindNoCase.
performs a <I>case-insensitive</I>
<H3>String 1 is less than String 2</H3>
<I>The strings are not equal</I>
<H3>String 1 is equal to String 2</H3>
<I>The strings are equal!</I>
<H3>String 1 is greater than String 2</H3>
<I>The strings are not equal</I>
<H3>This is the default case</H3>
295

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents