How to find the first occurrence of a substring in a string (case sensitive) in ColdFusion

Find() - find the first occurrence of a substring in a string (case sensitive)

Find.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Find function example: how to find the first occurrence of a substring in a string (case sensitive)</title>
</head>

<body>
<h2 style="color:hotpink">Find Function Example [Case sensitive]</h2>

<cfset MyString="Finds the first occurrence of a substring in a string, from a specified start position.">
<cfoutput>
<b>MyString:</b> #MyString#
<br />
<b>
MyString[find "string"]: #Find("string",MyString,0)#
</b>
</cfoutput>

<br /><br />
<cfset MyString="Finds the first occurrence of a substring in a string, from a specified start position.">
<cfoutput>
<b>MyString:</b> #MyString#
<br />
<b>
MyString[find "f"]: #Find("f",MyString,0)#
</b>
</cfoutput>

</body>
</html>





More ColdFusion examples