[thelist] Help with a replace loop
rudy
r937 at interlog.com
Tue Jun 12 11:46:16 CDT 2001
>I take it back; this still isn't working the way I'd like it to.
>
><cfloop query="getTerms">
> <cfif FindNoCase('#term#',varcopy) is not 0>
> <cfset varcopy = ReplaceNoCase(varcopy,'#term#','<a
href="http:///term.cfm/#term_id#.cfm"
title="#definition#">#term#</a>',"ALL")>
> </cfif>
></cfloop>
hi shinji
if you can assume there's a blank in front of every term in varcopy, then
use
ReplaceNoCase(varcopy,' #term#',
' <a href="http://term.cfm/#term_id#.cfm"
title="#definition#">#term#</a>',"ALL")
note the blank in front of the first #term# and in front of the <a
this won't catch the first word in a paragraph or the first word on a new
line, so you may need an additional step
rudy
http://rudy.ca/
More information about the thelist
mailing list