How to extracts a substring from a string in ColdFusion

Mid() - extracts a substring from a string

Mid.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mid function example: how to extracts a substring from a string</title>
</head>

<body>
<h2 style="color:HotPink">Mid Function Example</h2>

<cfset TestString="Test string for Mid function">
<cfoutput>
<b>
TestString: #TestString#
<br />
TestString[substring start 6, count 6]: #Mid(TestString,6,6)#
</b>
</cfoutput>

</body>
</html>





More ColdFusion examples