Insert - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

Insert

Description
Inserts a substring in a string after a specified character position. If
substring to the string.
Returns
A string.
Category
String functions
Function syntax
Insert(substring, string, position)
See also
RemoveChars,
Parameters
Parameter
substring
string
position
Example
<h3>Insert Example</h3>
<cfif IsDefined("FORM.myString")>
<!--- if the position is longer than the length of the string, err --->
<cfif FORM.insertPosition GT Len(MyString)>
<cfoutput>
<p>This string only has #Len(MyString)# characters; therefore,
you cannot insert the substring #FORM.mySubString# at position
#FORM.insertPosition#.
</cfoutput>
</cfif>
<cfelse>
<cfoutput>
<p>You inserted the substring #FORM.MySubstring# into the string
#FORM.MyString#, resulting in the following string:
<br>#Insert(FORM.MySubString, FORM.myString,
FORM.insertposition)#
</cfoutput>
</cfif>
522
Chapter 3: ColdFusion Functions
Len
Description
A string or a variable that contains one. String to insert.
A string or a variable that contains one. String into which to insert
Integer or variable; position in string after which to insert
= 0, prefixes the
position
substring
.
substring
.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents