Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hightlight Spaces 1

Status
Not open for further replies.

JCDugas

MIS
Dec 26, 2001
270
0
0
US
Anyone know how to hightlight the number of spaces in a string field?

What I want to do is hightlight three spaces with a certain color and hight two spaces with another.

Thanks,

Jeremy
 
Maybe I should have included this code. Spaces can be highlighted, I'm just not sure if I run through the field once then run through it again with another replace formula.



replace({FIELD}," ",
"<font color=red>"+"<b>"+"@@"+"</b>"+"</font color>")

Change the field Text Interpretation to HTML.

Jeremy
 
Looks like you need to search for the spaces to do the replace, did you try using the instr function to look for "^^^" in the text you are trying to highlight (^ indicates a space)?
 
You are not coloring a space here, but characters that you are plugging into a space, but I guess you know that.

Try the following where the longer space replace formula is nested within the shorter one:

replace(replace({FIELD}," ",
"<font color=red>"+"<b>"+"@@@"+"</b>"+"</font color>")," ", "<font color=blue>"+"<b>"+"@@"+"</b>"+"</font color>")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top