home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows the use of Replacelist --->
- <HTML>
-
- <HEAD>
- <TITLE>
- Replacelist Example
- </TITLE>
- </HEAD>
-
- <BODY bgcolor=silver>
-
- <H3>Replacelist Example</H3>
-
- <P>The Replacelist function returns <I>string</I> with
- <I>substringlist1</I> (e.g. "a,b") being replaced by <I>substringlist2</I> (e.g. "c,d") in
- the specified scope.
-
- <CFIF IsDefined("form.MyString")>
-
- <P>Your original string, <CFOUTPUT>#form.MyString#</CFOUTPUT>
- <P>You wanted to replace the substring <CFOUTPUT>#form.MySubstring1#</CFOUTPUT>
- with the substring <CFOUTPUT>#form.MySubstring2#</CFOUTPUT>.
- <P>The result: <CFOUTPUT>#Replacelist("#form.myString#", "#form.MySubstring1#", "#form.mySubString2#")#</CFOUTPUT>
-
-
-
- </CFIF>
-
- <FORM ACTION="replacelist.cfm" METHOD="POST">
- <P>String 1
- <BR><INPUT TYPE="Text" VALUE="My Test String" NAME="MyString">
-
- <P>Substring 1 (find this list of substrings)
- <BR><INPUT TYPE="Text" VALUE="Test, String" NAME="MySubstring1">
-
- <P>Substring 2 (replace with this list of substrings)
- <BR><INPUT TYPE="Text" VALUE="Replaced, Sentence" NAME="MySubstring2">
-
-
- <P><INPUT TYPE="Submit" VALUE="Replace and display" NAME="">
-
- </FORM>
-
-
- </BODY>
-
- </HTML>
-
-