A word from the author: This is made to support all C/C++ MUDs universally, and uses ANSI C for greatest compatibility. If your MUD doesn't have a "MAX_STRING_LENGTH" definition you can either add it (#define MAX_STRING_LENGTH 1024), or just replace MAX_STRING_LENGTH with 1024 (or some other arbitrary number). If you use this, I would ask that you give credit where credit is due, by either appending my name for this function in the credits function, or anywhere else so that the source of this function will be known in-game. I forgot to mention in the first version, but, if your MUD uses a different 'code' for colour strings, such as '#' or '}', then be sure to replace the & and/or ^ with the appropriate codes. And you could create a function called strip_unwanted if you just remove the index++ in the if check, and annotate all characters you don't want utilized. Enjoy the snippet, and keep on keepin' on! -Emhilradim Version 1.1: - Fixed an unneccessary number addition. So, now the MUD places the '\0' without the unneccessary space. - Removed DikuMUD style function calls -- they're not neccessary on a DikuMUD or DikuMUD derivative and they make the function incompatible with MUDs that don't use the args( ) type of function prototypes. - Made the text file 80-character length only on lines, for easier reading in browsers, and on lower resolutions. - Made the instructions non-specific. - Removed all calls to MUD-specific variables. INSTRUCTIONS: In a header file add: char * strip_colour(char *buf); In one of your source files add the following function anywhere: /* * The new strip colour function I wrote one day, to help with my rfind * function, because rooms with colour tags couldn't be identified. This * of course strips out all colour tags in a string, and returns a new * string -- this is so that the old string is still useable. I'd rather * use up a little bit more memory than destroy the original string. */ char * strip_colour(char *buf) { // Indices to examine and parse strings int index,new_index; // Our new uncoloured string static char new_buf[8096]; new_buf[0] = '\0'; // Start at position 0 and move up until we hit the last character. for(index=new_index=0;buf[index] != '\0';index++) { if( buf[index] == '&' || buf[index] == '^' ){ // Character is colour code, move up to next character index++; // Start the loop again, which ignores new place continue; } // Not colour code, so write character to string new_buf[new_index] = buf[index]; // Update the new index new_index++; } // Write end character to final space new_buf[new_index] = '\0'; // Return the new string return new_buf; }