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.

Categories

Related

Syntax

FindNoCase(substring, string [, start ])

Attributes

AttributeDescriptionRequiredDefault
startStart position of search.
stringA string or a variable that contains one. String in which to search.
substringA string or a variable that contains one. String for which to search.

Returns

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

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 position because the case is ignored.
<cfset stringToSearch = "The quick brown fox jumped over the lazy dog."> 
 
stringToSearch = <cfoutput>#stringToSearch#</cfoutput><br> 
 
Find Function:<br> 
Find("the",stringToSearch) returns <cfoutput>#find("the",stringToSearch)#</cfoutput><br> 
 
FindNoCase Function:<br> 
FindNoCase("the",stringToSearch) returns <cfoutput>#FindNoCase("the",stringToSearch)#</cfoutput>