world.StripANSI

MUSHclient script function (Method) — introduced in version 3.37

Strips ANSI colour sequences from a string

Prototype

BSTR StripANSI(BSTR Message);

Data type meanings

Description

This removes ANSI colour sequences from a string.

The intention of this routine is to be used with incoming chat messages (which may have ANSI colour codes in them), if you want to display them in a plain colour, or reformat using your own colours.

VBscript example

Note StripANSI (incoming_message)

Jscript example

Note (StripANSI (incoming_message));

PerlScript example

Note (StripANSI (incoming_message));

Python example

world.Note (StripANSI (world.incoming_message))

Lua example

Note (StripANSI (incoming_message))

Return value

The supplied string with ANSI colour sequences removed.

Related topic

Utilities

See also

FunctionDescription
ANSIGenerates an ANSI colour sequence
ChatMessageSends a message to a chat user (raw format)
NoteSends a note to the output window