trim: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added version.)
mNo edit summary
Line 7: Line 7:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
string(str)
trim(str)
</source>
</source>
'''Parameter'''
{{param|str|The string that has its leading and trailing white space removed.}}


|examples=
|examples=
Line 20: Line 22:
     :this is a test:
     :this is a test:
     :this is a test:
     :this is a test:
|also=
{{func|substring}}
}}
}}
[[Category:String Function]]
[[Category:String Function]]

Revision as of 07:55, 11 May 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

trim(str)

Parameter

  • str - The string that has its leading and trailing white space removed.

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:

See Also