trim

From RPTools Wiki
Revision as of 10:55, 14 December 2008 by Craig (talk | contribs) (New page: ==Function trim== Returns a copy of the string that is passed in with the leading and trailing white space removed. ===Usage=== <source lang="mtmacro" line> [h: str = string(str)] </sour...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function trim

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


Usage

[h: str = 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: