Adobe ColdFusion 8

FindNoCase

Description

Finds the first occurrence of a substring in a string, from a specified start position. If substring is not in string, returns zero. The search is case-insensitive.

Returns

The position of substring in string; or 0, if substring is not in string.

Category

String functions

Function syntax

FindNoCase(substring, string [, start ])

See also

Find, CompareNoCase, FindOneOf, REFind, Replace

Parameters

Parameter

Description

substring

A string or a variable that contains one. String for which to search.

string

A string or a variable that contains one. String in which to search.

start

Start position of search.

Example

In the following example, the Find function returns 33 as the first position found because "the" is lowercase. The FindNoCase function returns 1 as the first postion because the case is ignored.

<cfset stringToSearch = "The quick brown fox jumped over the lazy dog.">

stringToSearch = <cfoutput>#stringToSearch#</cfoutput><br>
<p>
Find Function:<br>
Find("the",stringToSearch) returns <cfoutput>#find("the",stringToSearch)#</cfoutput><br>
<p>
FindNoCase Function:<br>
FindNoCase("the",stringToSearch) returns <cfoutput>#FindNoCase("the",stringToSearch)#</cfoutput>