This is actually pretty easy. If you are using the colour snippet by
Lope, you take the string, and step through it till you find a {, or
what ever ur colour code is, and skip the next character, and keep on
building.
IE
{DThis {Gis {Ba {Gsample {Ystring{C.{x

You input this into *input. Then you check input
if input++ == '{' { input++; output++ = input++; } else { output++ =
input++; }

Which, all of that is inside of a for loop, of course. Just make sure
you look for the '/0' at the end of the string so u can break out of the
for loop.

Hope this helps out in helping you create your own colour stripper.

Rheede


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf 
> Of Hiddukel
> Sent: Monday, January 13, 2003 2:39 AM
> To: rom@rom.org
> Subject: stripping colors
> 
> 
> I have searched everywhere and can't find a snippet that has 
> a function for stripping color codes from a string and 
> returning the stripped version of the string.  Can anyone 
> help me out with some code for this? I'm using lopes colour 
> codes so they are in the format {g etc..  Any help on this 
> would be much appreciated.
> 
> Matt Bradbury


Reply via email to