Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Coloured strings

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126219] Re: Coloured strings
  • From: Adriano Pascoletti <adriano.pascoletti at uniud.it>
  • Date: Thu, 26 Apr 2012 05:24:25 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201204250432.AAA06468@smc.vnet.net>

ToString[<coloured string>] removes colors
Adriano Pascoletti

2012/4/25 David Bailey <dave at removedbailey.co.uk>

> If you take an expression such as:
> "ABCDEFGHIJKLMNOPQRSTUVWXYZ"//FullForm
>
> and colour some portions of the string, you obtain:
>
> \!\(\*
> TagBox[
> StyleBox["\"\<\\!\\(\\*\\nStyleBox[\\(ABC\\*\\n StyleBox[\\\"DEF\\\",\
> \\nFontColor->RGBColor[1, 0, 0]]GHIJKLMN\\*\\n \
> StyleBox[\\\"OPQRSTUV\\\",\\nFontColor->RGBColor[0, 0, 1]]WXYZ\\)]\\)\
> \>\"",
> ShowSpecialCharacters->False,
> ShowStringCharacters->True,
> NumberMarks->True],
> FullForm]\)
>
> I am wondering if anyone knows an easy way to remove the colouring from
> such a string - other than creating a fairly complicated string pattern
> (bearing in mind that the original string might contain unpaired quotes,
> etc!)
>
> David Bailey
> http://www.dbaileyconsultancy.co.uk
>
>


  • Prev by Date: CDF plugin for MediaWiki
  • Next by Date: is there internal variable like $0 in perl?
  • Previous by thread: Coloured strings
  • Next by thread: Re: Coloured strings