Randomize a Replace Problem…
Posted on 2006-07-16
I have a few paragraphs of text. I’m trying to replace the text “keyword” with a few things. Ideally I’m doing…
<cfset text = “This is a sentence about keyword and keyword is really a keyword of this sentence about keyword.”>
<cfset newtext = ReReplaceNoCase(text, "keyword", " <strong>keyword</strong> ", "all")>
However, I would like to randomize this. I don’t want every instance of “keyword” replaced with <strong>keyword</strong>. I want to alternate the replacements between…
How might I go about doing this??
Thanks for the pointers!