trim: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added version.)
Line 1: Line 1:
{{MacroFunction
{{MacroFunction
|name=trim
|name=trim
|version=1.3b48
|description=
|description=
Returns a copy of the string that is passed in with the leading and trailing white space removed.
Returns a copy of the string that is passed in with the leading and trailing white space removed.
Line 6: Line 7:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: str = string(str)]
string(str)
</source>
</source>



Revision as of 11:43, 10 March 2009

trim() Function

Introduced in version 1.3b48
Returns a copy of the string that is passed in with the leading and trailing white space removed.

Usage

string(str)

Examples

[r: ":" + trim("     this is a test") + ":"]
[r: ":" + trim("this is a test      ") + ":"]
[r: ":" + trim("     this is a test       ") + ":"]

Returns

   :this is a test:
   :this is a test:
:this is a test: