Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

coloring only some substring

  • To: mathgroup at
  • Subject: [mg55085] coloring only some substring
  • From: fartous at
  • Date: Fri, 11 Mar 2005 04:21:50 -0500 (EST)
  • Sender: owner-wri-mathgroup at

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]]


lst /. "to" -> "!(* StyleBox["to",FontColor->RGBColor[1, 0, 0]])"

lst /. "to" -> StyleForm["to", FontColor -> RGBColor[0, 0, 1]]

>>i have the list:
>>how to search for the string "to" and then to output the whole content of 
>>lst but with the substring "to" colored in red.

  • Prev by Date: Re: InitializationCell
  • Next by Date: how to set a global assumption setting Every Varaible I use is Real?
  • Previous by thread: Re: coloring only some substring
  • Next by thread: substrings at the end of words