coloring only some substring
- To: mathgroup at smc.vnet.net
- Subject: [mg55085] coloring only some substring
- From: fartous at mail15.com
- Date: Fri, 11 Mar 2005 04:21:50 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
thanks all for the solutions to coloring "to" substring, but these will not color "to" in the string "bottom" , any ideas? lst = {"to", "be", "or", "not", "to", "be", "bottom"}; lst /. x : "to" -> StyleForm[x, FontColor -> Hue[1]] Or: lst /. "to" -> "!(* StyleBox["to",FontColor->RGBColor[1, 0, 0]])" Or: lst /. "to" -> StyleForm["to", FontColor -> RGBColor[0, 0, 1]] thanks jack >>i have the list: >>lst={"to","be","or","not","to","be","bottom"} >>how to search for the string "to" and then to output the whole content of >>List >>lst but with the substring "to" colored in red. >>thanks >> >>jack