Name
Find
Synopsis
Find(substring, string
[,startpos
])
Returns the position of the first occurrence of
substring
in
string
. If
substring
isn’t found,
Find( )
returns 0. An optional starting position
for the search can be specified by the
startpos
parameter. Find( )
performs a case-sensitive search. Example:
<CFSET MyString="This is a case-sensitive example of using the Find function to find a substring within a string."> <CFSET MySubString="find"> <CFOUTPUT> <B>String:</B> #MyString#<BR> <B>Substring:</B> #MySubstring# <P>The first occurrence of <B>#MySubstring#</B> is at position #Find(MySubstring, MyString)#. </CFOUTPUT>
Get Programming ColdFusion now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.