Extracts a substring from a string.
A string; the set of characters from string, beginning at start, of length count.
Mid(string, start, count)
<h3>Mid Example</h3>
<cfif IsDefined("Form.MyText")>
<!--- if len is 0, then err --->
<cfif Len(FORM.myText) is not 0>
<cfif Len(FORM.myText) LTE FORM.RemoveChars>
<p>Your string <cfoutput>#FORM.myText#</cFOUTPUT> only has
<cfoutput>#Len(FORM.myText)#</cfoutput> characters. You cannot output
the <cfoutput>#FORM.removeChars# </cfoutput> middle characters of this
string because it is not long enough
<cfelse>
<p>Your original string: <cfoutput>#FORM.myText#</cfoutput>
<p>Your changed string, showing only the <cfoutput>#FORM.removeChars#
</cfoutput> middle characters:
<cfoutput>#Mid(Form.myText, FORM.removeChars, Form.countChars)#</cfoutput>
</cfif>
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6
Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt241.htm
Comments
No screen name said on Mar 9, 2006 at 10:34 PM :