world.Trim

MUSHclient script function (Method)

Trims leading and trailing spaces from a string

Prototype

BSTR Trim(BSTR Source);

Data type meanings

Description

This is supplied as a convenient way of removing leading and trailing spaces from a supplied string.

VBscript example

world.note "*" & world.trim ("  mystring  ") & "*"

Jscript example

world.Note("*" + world.Trim("  mystring  ") + "*");

PerlScript example

$world->Note("*" . $world->Trim("  mystring  ") . "*");

Python example

world.Note("*" + world.Trim("  mystring  ") + "*")

Lua example

Note("*" .. Trim("  mystring  ") .. "*")

Return value

The source string with any leading or trailing spaces removed.

Related topic

Utilities

See also

FunctionDescription
FixupEscapeSequencesConverts "escape sequences" like \t to their equivalent codes.
FixupHTMLFixes up text for writing as HTML
ReplaceReplaces one substring with another