Alright, figure out the index of the search string
in your larger string.


Then.. Figure out the length of the search string.

Now try something like this.


<CFSET BigStr = "Some big ole string">

<CFSET Pos = FindNocase("ole", BigStr)>

<CFSET searchStrLen = Len("ole")>

<CFSET BigStr = Insert("<FONT COLOR=""FF0000""><B>",
                Insert("</B></FONT>", BigStr, Pos+(searchStrLen-1)),
                (Pos-1))>

<CFOUTPUT>#BigStr#</CFOUTPUT>



The complicated part is the insert.

It basically says Insert a begin font tag into the follow string
(which just happens to be another insert. the innser insert
inserts a string which is a close BOLD and FONT tag at the END
of your search word (given that you know the length and its
beginning position).

Jeremy Allen
[EMAIL PROTECTED]
[Insert cool title here]


-----Original Message-----
From: Chapman, Katrina [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 16, 2000 2:39 PM
To: [EMAIL PROTECTED]
Subject: RE: replace function


Look at cf_highlight in the tag gallery.

--K

-----Original Message-----
From: Eli Shechter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 16, 2000 11:08 AM
To: [EMAIL PROTECTED]
Subject: replace function


Hi

i am using the replace function with a search interface,

that when the results come out, if the search word is within the results, to
turn that word "red"

However,
it replaces the word with a Red version of the search_word
#ReplaceNoCase(Description, Search_Word, theReplacedWord , 'ALL')#

the problem with this is that it replaces the Case of the word with the case
of the Search_word, Meaning if i search "pens" it will replace a instance of
the word "Pens" (uppercase) with the search_word version.

is there a way to search for the word and just replace the color without
replacing the word??

Thanx
-Eli-

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to